diff options
author | Eliot Horowitz <eliot@10gen.com> | 2009-08-20 13:23:21 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2009-08-20 13:23:21 -0400 |
commit | f0a26f673b19778ace2682ecf04b2d36dd9f8c9e (patch) | |
tree | 0f4bfb47e7950edd28deef1b875c29002b884a9c | |
parent | 7831db0d557a6464032a7181b524097208a25a05 (diff) | |
download | mongo-f0a26f673b19778ace2682ecf04b2d36dd9f8c9e.tar.gz |
skip empty lines
-rw-r--r-- | shell/dbshell.cpp | 4 |
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; { |