SERVER-3912: Make .dbshell file on windows be in user directory

instead of current directory.
This commit is contained in:
Spencer T Brody
2011-10-11 18:44:29 -04:00
parent 1ea7e499bc
commit 6d573a9a6e
3 changed files with 10 additions and 1 deletions

View File

@@ -878,6 +878,13 @@ namespace mongo {
#endif
}
const char* getUserDir() {
#ifdef _WIN32
return getenv( "USERPROFILE" );
#else
return getenv( "HOME" );
#endif
}
BSONObj getHostName(const BSONObj& a, void* data) {
uassert( 13411, "getHostName accepts no arguments", a.nFields() == 0 );
char buf[260]; // HOST_NAME_MAX is usually 255