GNU Pascal Homepage - gpc - gpc-announce - gpc-de - gpc-doc
Diese Seite auf deutsch

Mail #11304

Back to main page of archive

Previous mail   Next mail   Unformatted/full headers
Overview  10 days   Subject   Date   Thread   Author  

From: jan.ruzicka@comcast.net
Subject: EOF is not true on reset empty file
Date: 29 Jan 2005, 07:04:31

> +  if (n > 0) and (Buf2[n] = NewLine) then Dec (n);
Does this cope with famous <cr><lf> ?
Jan

On Jan 28, 2005, at 08:16, Frank Heckenbach wrote:

> 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
>
> -- 
> Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/, 7977168E
> GPC To-Do list, latest features, fixed bugs:
> http://www.gnu-pascal.de/todo.html
> GPC download signing key: ACB3 79B2 7EB2 B7A7 EFDE  D101 CD02 4C9D 
> 0FE0 E5E8
>

Previous mail   Next mail   Unformatted/full headers
Overview  10 days   Subject   Date   Thread   Author  


Replies

Author Subject Date
Frank Heckenbach EOF is not true on reset empty file 30 Jan 2005, 17:22:29

In reply to

Author Subject Date
Tom Schneider EOF is not true on reset empty file 27 Jan 2005, 02:49:12
Maurice Lombardi EOF is not true on reset empty file 27 Jan 2005, 17:41:49
Emil Jerabek EOF is not true on reset empty file 28 Jan 2005, 13:27:52
Frank Heckenbach EOF is not true on reset empty file 28 Jan 2005, 14:16:50

Back to main page of archive


Note: This page contains information that does not originate from the owner of this web site, but from the authors of the mails archived. The owner of this web site is not responsible for the content of such information. Any use of that infomation requires the consent of the respective author.

Where WWW addresses (URLs) in the mails archived are marked as hyperlinks, this is only for the comfort of the reader. The content of the web pages linked to like this does not necessarily reflect the opinion of the owner of this web site or of the authors of the mails archived. The owner of this web site is not responsible for the content of such web pages. Those pages are explicitly not to be considered as part of the content of this page, but merely as references.


This page was created by Crystal 0.999 (Linux 2.4.27/i686).