summaryrefslogtreecommitdiff
path: root/db/db.cpp
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2011-09-12 14:26:40 -0400
committerEliot Horowitz <eliot@10gen.com>2011-09-12 14:50:30 -0400
commitade41dcba82cff6ea004d9252ecf90b6a6d0443f (patch)
treed0e2046de547c2edc71c671e6ea6f88385265554 /db/db.cpp
parent1c064ab91579aca2a5a4634c9ad2b64386db98cd (diff)
downloadmongo-ade41dcba82cff6ea004d9252ecf90b6a6d0443f.tar.gz
Strip trailing / of dbpath on windows SERVER-3557
Diffstat (limited to 'db/db.cpp')
-rw-r--r--db/db.cpp6
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;