Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2005-05

THE CAUSE OF BUG 3977 (read/readln bug)

7 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

lqs

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.

Reply by email

Marco van de Voort
to lqs

[ Charset ISO-8859-1 unsupported, converting... ]

Show quoted text 7 lines
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.
Committed, but I put nextchar:=false as first line and removed the else.

SVN rev 15

Reply by email

lqs
to Marco van de Voort

When will the next version release? This is a serious bug.

2005/5/18, Marco van de Voort :

Show quoted text 13 lines
[ Charset ISO-8859-1 unsupported, converting... ] > 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. Committed, but I put nextchar:=false as first line and removed the else. SVN rev 15

Reply by email

Jonas Maebe
to Peter Vreman
Peter Vreman wrote
> When will the next version release? This is a serious bug. If it was really serious it would have already been found years ago.

No, it was only relatively recently introduced while fixing another bug (on 3 April 2005).

Jonas

Reply by email

Tom Verhoeff
Show quoted text 12 lines
From: lqs Subject: [fpc-devel] THE CAUSE OF BUG 3977 (read/readln bug) Date: Wed, 18 May 2005 16:40:50 +0800 To: 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

Reply by email