Hello pascal programmers, this is interesting for me, it solves some problems I have.
I have unzipped gpc.fiff-emil2.gz but I don't know how to apply the patch.
Here is my compiler output :
================================================ bash-2.04$ cd Pascal/ bash-2.04$ ./echo3lines.out Enter the first line: first line first line Enter the second line: second line second line Enter the last line: bash-2.04$ gpc -v Reading specs from /usr/local/lib/gcc-lib/i386--freebsd4.2/2.8.1/specs gpc version 19990118, based on gcc-2.8.1 bash-2.04$ gpc echo3lines.pas -o echo3lines.out bash-2.04$ Dec 29 12:13:48 earth login: ROOT LOGIN (root) ON ttyv1
GNU Pascal version 2.8.1 (i386--freebsd4.2) compiled by GNU C version 2.8.1.
==========================================================
Please help me to apply this patch under FreeBSD
Yours Sincerely
Morten Gulbrandsen
Emil Jerabek wrote:
Accordnig to both ISO standards, readln(f) should be equivalent to get(f), when eoln(f) is true. In GPC the former seems to be implemented as lazy I/O, while the latter does not.
Here is an example (enter three lines of text to test it).
program echo3lines(input,output);
procedure copyline; begin while not eoln do begin output^:=input^; get(input); put(output) end end;
begin write('Enter the first line: '); copyline; readln; writeln; write('Enter the second line: '); copyline; get(input); writeln; write('Enter the last line: '); copyline; readln; writeln end.
Is this a bug or a feature?
Emil Jerabek