From c47b4c91aefbea91bd8405013a5b9f8c6567c99b Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Fri, 23 Feb 2007 19:27:43 +0000 Subject: Avoiding to wait forever under Cygwin. (STR #1608) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5712 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- test/demo.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') diff --git a/test/demo.cxx b/test/demo.cxx index ee75b2424..32a4687de 100644 --- a/test/demo.cxx +++ b/test/demo.cxx @@ -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; -- cgit v1.2.3