bug 613516 - xpcshell dump doesn't print newlines. r=jorendorff
authorIgor Bukanov <igor@mir2.org>
Tue, 23 Nov 2010 14:40:55 +0100
changeset 58679 f710194a96eca6f0719c1a20a1dc7f4ff7b68b1d
parent 58298 2000c21b7910d18da2319f63751ab7a6f73a12f9
child 58680 514dd5bdcaa0bfb3de1986f6a658f4b100246880
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersjorendorff
bugs613516
milestone2.0b8pre
bug 613516 - xpcshell dump doesn't print newlines. r=jorendorff
js/src/xpconnect/shell/xpcshell.cpp
--- a/js/src/xpconnect/shell/xpcshell.cpp
+++ b/js/src/xpconnect/shell/xpcshell.cpp
@@ -444,17 +444,21 @@ Dump(JSContext *cx, uintN argc, jsval *v
     JSString *str;
     if (!argc)
         return JS_TRUE;
 
     str = JS_ValueToString(cx, JS_ARGV(cx, vp)[0]);
     if (!str)
         return JS_FALSE;
 
-    JS_FileEscapedString(gOutFile, str, 0);
+    JSAutoByteString bytes(cx, str);
+    if (!bytes)
+        return JS_FALSE;
+    
+    fputs(bytes.ptr(), gOutFile);
     fflush(gOutFile);
     return JS_TRUE;
 }
 
 static JSBool
 Load(JSContext *cx, uintN argc, jsval *vp)
 {
     uintN i;