diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx index 03757935f..eec57746e 100644 --- a/src/Fl_Input_.cxx +++ b/src/Fl_Input_.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Input_.cxx,v 1.6 1998/11/06 20:14:41 mike Exp $" +// "$Id: Fl_Input_.cxx,v 1.7 1998/11/10 14:40:56 mike Exp $" // // Common input widget routines for the Fast Light Tool Kit (FLTK). // @@ -504,16 +504,15 @@ int Fl_Input_::replace(int b, int e, const char* text, int ilen) { } if (ilen) { - size_ += ilen; if (undowidget == this && b == undoat) undoinsert += ilen; else { undocut = 0; undoinsert = ilen; } - int i; - for (i=size_; i>b; i--) buffer[i] = buffer[i-ilen]; - for (i=0; ib; i--) buffer[i] = buffer[i-ilen]; - for (i=0; i len) return; + if (value_ == buffer && bufsize > len) { + buffer[size_] = 0; + return; + } if (!bufsize) { if (len > size_) len += 9; // let a few characters insert before realloc bufsize = len+1; @@ -725,5 +727,5 @@ Fl_Input_::~Fl_Input_() { } // -// End of "$Id: Fl_Input_.cxx,v 1.6 1998/11/06 20:14:41 mike Exp $". +// End of "$Id: Fl_Input_.cxx,v 1.7 1998/11/10 14:40:56 mike Exp $". //