Commit 444e9ebf authored by rswindell's avatar rswindell
Browse files

File.readln() method, and by extension, readAll(), no longer truncates

whitespace off ends of lines.
parent a89c0afe
......@@ -252,7 +252,10 @@ js_readln(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
return(JS_TRUE);
if(fgets(buf,len,p->fp)!=NULL) {
truncsp(buf);
len=strlen(buf);
while(len>0 && (buf[len-1]=='\r' || buf[len-1]=='\n'))
len--;
buf[len]=0;
if(p->etx) {
cp=strchr(buf,p->etx);
if(cp) *cp=0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment