Fix bug 423043, js shell print() should flush stdout. r+a=shaver. Does not affect Firefox.
authorjruderman@hmc.edu
Mon, 17 Mar 2008 13:25:23 -0700
changeset 13193 87d9c4e9f7ff0a84c60518de1329da7c0e5e060b
parent 13192 414b9da09c5727784c2e4885aa6db36d322f7476
child 13194 4270e71d78afdf7b5149ace633f1d99740667a00
push idunknown
push userunknown
push dateunknown
bugs423043
milestone1.9b5pre
Fix bug 423043, js shell print() should flush stdout. r+a=shaver. Does not affect Firefox.
js/src/js.c
--- a/js/src/js.c
+++ b/js/src/js.c
@@ -753,17 +753,20 @@ Print(JSContext *cx, JSObject *obj, uint
         if (!str)
             return JS_FALSE;
         bytes = JS_EncodeString(cx, str);
         if (!bytes)
             return JS_FALSE;
         fprintf(gOutFile, "%s%s", i ? " " : "", bytes);
         JS_free(cx, bytes);
     }
+
     fputc('\n', gOutFile);
+    fflush(gOutFile);
+
     return JS_TRUE;
 }
 
 static JSBool
 Help(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
 
 static JSBool
 Quit(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)