From 2e443a2fdf54d97c1d223ea5ffbb375317ad8422 Mon Sep 17 00:00:00 2001 From: "alex%croczilla.com" Date: Mon, 12 Jun 2006 14:03:31 +0000 Subject: [PATCH] Add 'plain' protocol (no prompts, no welcome message). JSSh only - Not part of default build. git-svn-id: svn://10.0.0.236/trunk@199699 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/extensions/jssh/nsJSSh.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mozilla/extensions/jssh/nsJSSh.cpp b/mozilla/extensions/jssh/nsJSSh.cpp index 74e37cb4f8e..5fad3f34d00 100644 --- a/mozilla/extensions/jssh/nsJSSh.cpp +++ b/mozilla/extensions/jssh/nsJSSh.cpp @@ -268,10 +268,17 @@ SetProtocol(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) if (!strcmp(protocol, "interactive")) { shell->mEmitHeader = PR_FALSE; + shell->mPrompt = NS_LITERAL_CSTRING("\n> "); shell->mProtocol = protocol; } else if (!strcmp(protocol, "synchronous")) { shell->mEmitHeader = PR_TRUE; + shell->mPrompt = NS_LITERAL_CSTRING("\n> "); + shell->mProtocol = protocol; + } + else if (!strcmp(protocol, "plain")) { + shell->mEmitHeader = PR_FALSE; + shell->mPrompt = NS_LITERAL_CSTRING("\n"); shell->mProtocol = protocol; } else return JS_FALSE; @@ -476,7 +483,7 @@ NS_IMETHODIMP nsJSSh::Run() if (mInput) { // read-eval-print loop PRUint32 bytesWritten; - if (mOutput) + if (mOutput && mProtocol != NS_LITERAL_CSTRING("plain")) mOutput->Write(gWelcome, strlen(gWelcome), &bytesWritten); while (!mQuit) {