diff options
author | Mathias Stearn <mathias@10gen.com> | 2011-09-12 14:26:40 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2011-09-12 14:50:30 -0400 |
commit | ade41dcba82cff6ea004d9252ecf90b6a6d0443f (patch) | |
tree | d0e2046de547c2edc71c671e6ea6f88385265554 /db/db.cpp | |
parent | 1c064ab91579aca2a5a4634c9ad2b64386db98cd (diff) | |
download | mongo-ade41dcba82cff6ea004d9252ecf90b6a6d0443f.tar.gz |
Strip trailing / of dbpath on windows SERVER-3557
Diffstat (limited to 'db/db.cpp')
-rw-r--r-- | db/db.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/db/db.cpp b/db/db.cpp index e6281d7f071..b1d1db8054d 100644 --- a/db/db.cpp +++ b/db/db.cpp @@ -708,6 +708,12 @@ int main(int argc, char* argv[]) { else { dbpath = "/data/db/"; } +#ifdef _WIN32 + if (dbpath.size() > 1 && dbpath[dbpath.size()-1] == '/') { + // size() check is for the unlikely possibility of --dbpath "/" + dbpath = dbpath.erase(dbpath.size()-1); + } +#endif if ( params.count("directoryperdb")) { directoryperdb = true; |