summaryrefslogtreecommitdiff
path: root/shell/dbshell.cpp
diff options
context:
space:
mode:
authorAntonin Kral <a.kral@bobek.cz>2011-12-15 09:35:47 +0100
committerAntonin Kral <a.kral@bobek.cz>2011-12-15 09:35:47 +0100
commitf0d9a01bccdaeb466c12c92057914bbfef59526c (patch)
tree7679efa1f0daf7d1d906882a15dc77af6b7aef32 /shell/dbshell.cpp
parent5d342a758c6095b4d30aba0750b54f13b8916f51 (diff)
downloadmongodb-f0d9a01bccdaeb466c12c92057914bbfef59526c.tar.gz
Imported Upstream version 2.0.2
Diffstat (limited to 'shell/dbshell.cpp')
-rw-r--r--shell/dbshell.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/shell/dbshell.cpp b/shell/dbshell.cpp
index f3122c7..443973f 100644
--- a/shell/dbshell.cpp
+++ b/shell/dbshell.cpp
@@ -398,13 +398,14 @@ string finishCode( string code ) {
while ( ! isBalanced( code ) ) {
inMultiLine = 1;
code += "\n";
+ // cancel multiline if two blank lines are entered
+ if ( code.find("\n\n\n") != string::npos )
+ return ";";
char * line = shellReadline("... " , 1 );
if ( gotInterrupted )
return "";
if ( ! line )
return "";
- if ( code.find("\n\n") != string::npos ) // cancel multiline if two blank lines are entered
- return ";";
while (startsWith(line, "... "))
line += 4;