Skip to content
Snippets Groups Projects
Commit c5fa5951 authored by rswindell's avatar rswindell
Browse files

readln() trims new-line chars off end of string.

parent acd5bd76
No related branches found
No related tags found
No related merge requests found
......@@ -246,7 +246,7 @@ js_readln(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
p=fgets(buf,len+1,stdin);
if(p!=NULL)
*rval = STRING_TO_JSVAL(JS_NewStringCopyZ(cx,p));
*rval = STRING_TO_JSVAL(JS_NewStringCopyZ(cx,truncnl(p)));
free(buf);
return(JS_TRUE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment