summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-06-22 09:31:28 -0400
committerEliot Horowitz <eliot@10gen.com>2009-06-22 09:31:28 -0400
commit7cb14f0951f499d86dbc8feabd851618af92f61c (patch)
tree1c26634d5cdfdea99dd9cb50a9c9c36afd3ab353
parentb0dbe2735b168ccbde56fd6f5faab4cfbd17ab36 (diff)
downloadmongo-7cb14f0951f499d86dbc8feabd851618af92f61c.tar.gz
fix bug with shell helper
-rw-r--r--shell/dbshell.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/shell/dbshell.cpp b/shell/dbshell.cpp
index 8db5bde907c..982ca44a39b 100644
--- a/shell/dbshell.cpp
+++ b/shell/dbshell.cpp
@@ -313,10 +313,12 @@ int main(int argc, char* argv[]) {
if ( cmd.find( " " ) > 0 )
cmd = cmd.substr( 0 , cmd.find( " " ) );
- scope->exec( (string)"__iscmd__ = shellHelper[\"" + cmd + "\"];" , "(shellhelp1)" , false , true , true );
- if ( scope->getBoolean( "__iscmd__" ) ){
- scope->exec( (string)"shellHelper( \"" + cmd + "\" , \"" + code.substr( cmd.size() ) + "\");" , "(shellhelp2)" , false , true , false );
- wascmd = true;
+ if ( cmd.find( "\"" ) == string::npos ){
+ scope->exec( (string)"__iscmd__ = shellHelper[\"" + cmd + "\"];" , "(shellhelp1)" , false , true , true );
+ if ( scope->getBoolean( "__iscmd__" ) ){
+ scope->exec( (string)"shellHelper( \"" + cmd + "\" , \"" + code.substr( cmd.size() ) + "\");" , "(shellhelp2)" , false , true , false );
+ wascmd = true;
+ }
}
}