diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2016-12-05 17:03:29 +0000 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2016-12-05 17:03:29 +0000 |
| commit | b6bd386231b9c8a385f1402bed44514f8dc02ffa (patch) | |
| tree | befa7448218ded9865fdf5054b51b857d5324661 /src | |
| parent | 0701204518430a4e348f04672d99b495cffc09ad (diff) | |
Fl_Text_Buffer constructor: fix "requestedSize ignored in mGapEnd".
mGapEnd should reflect the total allocated size after the constructor
is executed, i.e. the text buffer is empty. This was not the case.
See thread "Fl_Text_Buffer constructor bug" (2016-12-05) in fltk.general.
The bug was harmless, but the pre-allocation did not work as expected, i.e.
the pre-allocated buffer size was allocated but effectively ignored later.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12134 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_Text_Buffer.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
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; - } +} /* |
