Skip to content
Snippets Groups Projects
Commit 3bedb0f3 authored by Fredrik Hübinette (Hubbe)'s avatar Fredrik Hübinette (Hubbe)
Browse files

bugfix for Stdio.FILE->gets() [bug 5]

Rev: lib/modules/Stdio.pmod/module.pmod:1.84
parent d6d2250e
No related branches found
No related tags found
No related merge requests found
// $Id: module.pmod,v 1.83 2000/08/27 18:29:27 mirar Exp $ // $Id: module.pmod,v 1.84 2000/08/28 21:08:28 hubbe Exp $
import String; import String;
...@@ -497,7 +497,13 @@ class FILE { ...@@ -497,7 +497,13 @@ class FILE {
while((p=search(b, "\n", bpos+tmp)) == -1) while((p=search(b, "\n", bpos+tmp)) == -1)
{ {
tmp=strlen(b)-bpos; tmp=strlen(b)-bpos;
if(!get_data()) return 0; if(!get_data())
{
if(bpos==sizeof(b))
return 0;
else
return extract(sizeof(b)-bpos,0);
}
} }
return extract(p-bpos, 1); return extract(p-bpos, 1);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment