Author: AlbrechtS
Date: 2009-10-05 06:06:33 -0700 (Mon, 05 Oct 2009)
New Revision: 6915
Log:
TextEditor::text() returned garbage if the "gap" was at the beginning of
the text buffer (STR #1987).
Modified:
trunk/CHANGES
trunk/src/TextBuffer.cxx
Modified: trunk/CHANGES
===================================================================
--- trunk/CHANGES 2009-10-03 15:55:53 UTC (rev 6914)
+++ trunk/CHANGES 2009-10-05 13:06:33 UTC (rev 6915)
@@ -2577,4 +2577,9 @@
(STR #2202, #2205, #2223)
+////////////////////////////////////////////////////////////////
+Fixed TextEditor::text() would return garbage if the "gap" is at the
+beginning of the text buffer (STR #1987)
+
+
Modified: trunk/src/TextBuffer.cxx
===================================================================
--- trunk/src/TextBuffer.cxx 2009-10-03 15:55:53 UTC (rev 6914)
+++ trunk/src/TextBuffer.cxx 2009-10-05 13:06:33 UTC (rev 6915)
@@ -160,13 +160,13 @@
const char *TextBuffer::text() {
if (!gapstart_ && length_) {
buf_[length_+gapend_] = 0;
- return buf_+gapstart_;
+ return buf_+gapend_;
}
if (gapstart_ < gapend_) {
memmove(&buf_[gapstart_], &buf_[gapend_], length_-gapstart_);
gapstart_ = gapend_ = length_;
}
- buf_[length_] = 0; // add null terminator, assumme length < buffer size!
+ buf_[length_] = 0; // add null terminator, assume length < buffer size!
return buf_;
}
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit