summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES2
-rw-r--r--src/Fl_Text_Buffer.cxx4
2 files changed, 4 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index adb05fb14..18f7bd153 100644
--- a/CHANGES
+++ b/CHANGES
@@ -42,6 +42,8 @@ Changes in FLTK 1.4.0 Released: ??? ?? 2017
Bug Fixes
- (add here)
+ - Fix ignored buffer pre-allocation (requestedSize) in Fl_Text_Buffer.
+ See fltk.general "Fl_Text_Buffer constructor bug" on Dec 5, 2016.
- Fix build with configure --enable-cairo --enable-cairoext,
see this report in fltk.general:
https://groups.google.com/forum/#!topic/fltkgeneral/x80qQ6wt0s4
diff --git a/src/Fl_Text_Buffer.cxx b/src/Fl_Text_Buffer.cxx
index c4a935a81..9efcd6609 100644
--- a/src/Fl_Text_Buffer.cxx
+++ b/src/Fl_Text_Buffer.cxx
@@ -108,7 +108,7 @@ Fl_Text_Buffer::Fl_Text_Buffer(int requestedSize, int preferredGapSize)
mPreferredGapSize = preferredGapSize;
mBuf = (char *) malloc(requestedSize + mPreferredGapSize);
mGapStart = 0;
- mGapEnd = mPreferredGapSize;
+ mGapEnd = requestedSize + mPreferredGapSize;
mTabDist = 8;
mPrimary.mSelected = 0;
mPrimary.mStart = mPrimary.mEnd = 0;
@@ -1421,7 +1421,7 @@ void Fl_Text_Buffer::reallocate_with_gap(int newGapStart, int newGapLen)
mBuf = newBuf;
mGapStart = newGapStart;
mGapEnd = newGapEnd;
- }
+}
/*