fix CR in read_line_to_codes
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2219 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
3edc72b4c1
commit
d8488ec48e
@ -66,7 +66,11 @@ rl_to_codes(Term TEnd, int do_as_binary, int arity)
|
|||||||
Term end;
|
Term end;
|
||||||
UNLOCK(Stream[sno].streamlock);
|
UNLOCK(Stream[sno].streamlock);
|
||||||
if (!(do_as_binary || Stream[sno].status & Eof_Stream_f)) {
|
if (!(do_as_binary || Stream[sno].status & Eof_Stream_f)) {
|
||||||
buf[sz-1] = '\0';
|
/* handle CR before NL */
|
||||||
|
if (sz-2 >= 0 && buf[sz-2] == 13)
|
||||||
|
buf[sz-2] = '\0';
|
||||||
|
else
|
||||||
|
buf[sz-1] = '\0';
|
||||||
}
|
}
|
||||||
if (arity == 2)
|
if (arity == 2)
|
||||||
end = TermNil;
|
end = TermNil;
|
||||||
|
Reference in New Issue
Block a user