File tree Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -565,16 +565,27 @@ namespace mongo {
565565 if ( ! possible.size () ) {
566566 possible.push_back ( " ./" );
567567 possible.push_back ( " ../" );
568-
568+
569569 log (2 ) << " dbExecCommand: " << dbExecCommand << endl;
570- if ( dbExecCommand.find ( " /" ) != std::string::npos ){
571- string dbDir = dbExecCommand.substr ( 0 , dbExecCommand.find_last_of ( " /" ) );
572- log (2 ) << " dbDir [" << dbDir << " ]" << endl;
573- possible.push_back ( ( dbDir + " /../lib/mongo/" ));
574- possible.push_back ( ( dbDir + " /../lib64/mongo/" ));
575- possible.push_back ( ( dbDir + " /../lib32/mongo/" ));
576- }
577570
571+ string dbDir = dbExecCommand;
572+ #ifdef WIN32
573+ if ( dbDir.find ( " \\ " ) != string::npos ){
574+ dbDir = dbDir.substr ( 0 , dbDir.find_last_of ( " \\ " ) );
575+ }
576+ #else
577+ if ( dbDir.find ( " /" ) != string::npos ){
578+ dbDir = dbDir.substr ( 0 , dbDir.find_last_of ( " /" ) );
579+ }
580+ #endif
581+ else {
582+ dbDir = " ." ;
583+ }
584+
585+ log (2 ) << " dbDir [" << dbDir << " ]" << endl;
586+ possible.push_back ( ( dbDir + " /../lib/mongo/" ));
587+ possible.push_back ( ( dbDir + " /../lib64/mongo/" ));
588+ possible.push_back ( ( dbDir + " /../lib32/mongo/" ));
578589 }
579590
580591 for ( list<string>::iterator i = possible.begin () ; i != possible.end (); i++ ) {
You can’t perform that action at this time.
0 commit comments