Skip to content

Commit

Permalink
Fix infinite loop bug in Fl_Text_Display::resize()...
Browse files Browse the repository at this point in the history
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2599 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
michaelrsweet committed Aug 20, 2002
1 parent 5ab5eff commit 36e719a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGES
@@ -1,5 +1,7 @@
CHANGES IN FLTK 1.1.0

- Fl_Text_Display::resize() could go into an infinite
loop if the buffer is emptied.
- Fl::handle() didn't pass FL_RELEASE events to the
grab() widget if pushed() was set (for proper menu
handling...)
Expand Down
6 changes: 3 additions & 3 deletions src/Fl_Text_Display.cxx
@@ -1,5 +1,5 @@
//
// "$Id: Fl_Text_Display.cxx,v 1.12.2.26 2002/08/15 17:26:46 easysw Exp $"
// "$Id: Fl_Text_Display.cxx,v 1.12.2.27 2002/08/20 17:12:19 easysw Exp $"
//
// Copyright 2001-2002 by Bill Spitzak and others.
// Original code Copyright Mark Edel. Permission to distribute under
Expand Down Expand Up @@ -301,7 +301,7 @@ void Fl_Text_Display::resize(int X, int Y, int W, int H) {
scroll_(mTopLineNumHint, mHorizOffsetHint);

// everything will fit in the viewport
if (mNBufferLines < mNVisibleLines)
if (mNBufferLines < mNVisibleLines || mBuffer == NULL || mBuffer->length() == 0)
scroll_(1, mHorizOffset);
/* if empty lines become visible, there may be an opportunity to
display more text by scrolling down */
Expand Down Expand Up @@ -1976,5 +1976,5 @@ int Fl_Text_Display::handle(int event) {


//
// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.26 2002/08/15 17:26:46 easysw Exp $".
// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.27 2002/08/20 17:12:19 easysw Exp $".
//

0 comments on commit 36e719a

Please sign in to comment.