summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-08-20 13:23:21 -0400
committerEliot Horowitz <eliot@10gen.com>2009-08-20 13:23:21 -0400
commitf0a26f673b19778ace2682ecf04b2d36dd9f8c9e (patch)
tree0f4bfb47e7950edd28deef1b875c29002b884a9c
parent7831db0d557a6464032a7181b524097208a25a05 (diff)
downloadmongo-f0a26f673b19778ace2682ecf04b2d36dd9f8c9e.tar.gz
skip empty lines
-rw-r--r--shell/dbshell.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/shell/dbshell.cpp b/shell/dbshell.cpp
index f6208518d52..1f09709c278 100644
--- a/shell/dbshell.cpp
+++ b/shell/dbshell.cpp
@@ -301,7 +301,7 @@ int _main(int argc, char* argv[]) {
if ( line )
while ( line[0] == ' ' )
line++;
-
+
if ( ! line || ( strlen(line) == 4 && strstr( line , "exit" ) ) ){
cout << "bye" << endl;
break;
@@ -311,6 +311,8 @@ int _main(int argc, char* argv[]) {
if ( code == "exit" ){
break;
}
+ if ( code.size() == 0 )
+ continue;
bool wascmd = false;
{