Freeze While Parsing Prelude

Jeff Binder obvious@fuse.net
Sat, 28 Sep 2002 16:33:10 -0400


On my system (Gentoo Linux PPC, GCC 2.95.3), Hugs goes into an infinite 
loop while parsing the Prelude file. The problem is in input.c, lines 
515 and 516:

         lineBuffer[lineLength] = fgetc(inputStream);
         if (lineBuffer[lineLength] == EOF)

The value of EOF cannot be stored in a char on this system, so 
'lineBuffer[lineLength] == EOF' always evaluates to 0. Here's a fix:

         int ch = fgetc(inputStream);
         lineBuffer[lineLength] = ch;
         if (ch == EOF)

Glad to help,
Jeff Binder