Skip to content

Commit

Permalink
Avoiding to wait forever under Cygwin. (STR #1608)
Browse files Browse the repository at this point in the history
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5712 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
Matthias Melcher committed Feb 23, 2007
1 parent 7696c64 commit c47b4c9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Fl_win32.cxx
Expand Up @@ -267,6 +267,11 @@ int fl_wait(double time_to_wait) {
if (Fl::idle || Fl::damage())
time_to_wait = 0.0;

// if there are no more windows and this timer is set
// to FOREVER, continue through or look up indefinetely
if (!Fl::first_window() && time_to_wait==1e20)
time_to_wait = 0.0;

fl_unlock_function();

time_to_wait = (time_to_wait > 10000 ? 10000 : time_to_wait);
Expand Down
8 changes: 8 additions & 0 deletions test/demo.cxx
Expand Up @@ -306,6 +306,14 @@ int load_the_menu(const char* fname)
}
for (;;) {
if (fgets(line,256,fin) == NULL) break;
// remove all carriage returns that Cygwin may have inserted
char *s = line, *d = line;
for (;;++d) {
while (*s=='\r') s++;
*d = *s++;
if (!*d) break;
}
// interprete the line
j = 0; i = 0;
while (line[i] == ' ' || line[i] == '\t') i++;
if (line[i] == '\n') continue;
Expand Down

0 comments on commit c47b4c9

Please sign in to comment.