0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

remove whitespace before trailing ; in shell helpers SERVER-3001

This was causing issues when someone typed "use some_db ;" into the shell
This commit is contained in:
Mathias Stearn 2011-05-02 13:28:11 -04:00
parent 26c85ceb23
commit ef373aa1de
2 changed files with 2 additions and 2 deletions

View File

@ -1051,7 +1051,7 @@ const StringData _jscode_raw_utils =
"\n"
"shellHelper = function( command , rest , shouldPrint ){\n"
"command = command.trim();\n"
"var args = rest.trim().replace(/;$/,\"\").split( \"\\s+\" );\n"
"var args = rest.trim().replace(/\\s+;$/,\"\").split( \"\\s+\" );\n"
"\n"
"if ( ! shellHelper[command] )\n"
"throw \"no command [\" + command + \"]\";\n"

View File

@ -1046,7 +1046,7 @@ shellAutocomplete.showPrivate = false; // toggle to show (useful when working on
shellHelper = function( command , rest , shouldPrint ){
command = command.trim();
var args = rest.trim().replace(/;$/,"").split( "\s+" );
var args = rest.trim().replace(/\s+;$/,"").split( "\s+" );
if ( ! shellHelper[command] )
throw "no command [" + command + "]";