Emil Jerabek wrote:
Incidentally, I tried it without --transparent-file-names (gpc 20041218, gcc 3.3.3), and got:
[~/pas]% ./a.out Input file `namebook': namebook ./a.out: cannot open file `namebook ' for reading (No such file or directory) (error #442 at 8049e79)
I.e., the name of the file includes the newline which is necessary to terminate the input! This is IMO another bug.
Yes, this bug slipped in when I ported the file handling from C to Pascal.
--- rts/files.pas.orig Sun Nov 14 04:38:58 2004 +++ rts/files.pas Fri Jan 28 14:16:01 2005 @@ -1154,7 +1154,7 @@ if Tty >= 0 then Discard (CloseHandle (Tty)); if (n > 0) and (Buf2[1] = EOT) then IOERROR_FILE (421, f, False, ''); { EOT character given for query of file name for %s } - if (n > 0) and (Buf2[n] = '\n') then Dec (n); + if (n > 0) and (Buf2[n] = NewLine) then Dec (n); Inc (n); Buf2[n] := #0; Tmp := InternalNew (n);
Frank