[fpc-devel] THE CAUSE OF BUG 3977 (read/readln bug)

Tom Verhoeff T.Verhoeff at tue.nl
Wed May 18 22:43:24 CEST 2005


On Wed, May 18, 2005 at 12:00:10PM +0200, fpc-devel-request at lists.freepascal.org wrote:
> From: lqs <lqs2004 at gmail.com>
> Subject: [fpc-devel] THE CAUSE OF BUG 3977 (read/readln bug)
> Date: Wed, 18 May 2005 16:40:50 +0800
> To: fpc-devel at lists.freepascal.org
> 
> Yesterday I posted a bug report of the read/readln bug in the rtl, in
> the link http://www.freepascal.org/bugs/showrec.php3?ID=3977 . I
> examined the rtl source today and found what causes the bug. In the
> file fpc/rtl/inc/text.inc, line 756, there is a function called
> NextChar. The last two line in the function, "else NextChar:=false",
> the corresponding "if" is the second one. So I added another "else
> NextChar:=false", and everything works well.

This bug took me by surprise.  It turned out that the first program
that I tried with the 2.0 compiler ran into the bug, because (and this
surprised me) many of my input files had missing eoln on the last line
of the file.  Previously, I had no problems (under Linux, MacOSX),
so I was not aware of the formatting variations.  Actually, I am also
thankful that I discovered this :-).

Let me add to this my compliments to the development team for a job well
done.

	Tom
-- 
E-MAIL: T.Verhoeff @ TUE.NL     | Fac. of Math. & Computing Science
PHONE:  +31 40 247 41 25        | Eindhoven University of Technology
FAX:    +31 40 247 54 04        | PO Box 513, NL-5600 MB Eindhoven
http://www.win.tue.nl/~wstomv/  | The Netherlands




More information about the fpc-devel mailing list