diff options
author | Andy Schwerin <schwerin@10gen.com> | 2012-10-15 10:48:44 -0400 |
---|---|---|
committer | Andy Schwerin <schwerin@10gen.com> | 2012-10-15 11:42:40 -0400 |
commit | 498c99b00cc2f087fdd3f7321044a96af30bfb8c (patch) | |
tree | 18c5b09b048c3c8670b814f9eac61e975e7d0cec /src | |
parent | 3342a6ec9cb3a79794587c8d2927257617fbf60d (diff) | |
download | mongo-498c99b00cc2f087fdd3f7321044a96af30bfb8c.tar.gz |
SERVER-7341 Make mongorestore correclty interpret backslash as a path separator.
This affects how mongorestore converts a path into a namespace name.
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/tools/restore.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/mongo/tools/restore.cpp b/src/mongo/tools/restore.cpp index f9f9fe1d262..c3e9570dea5 100644 --- a/src/mongo/tools/restore.cpp +++ b/src/mongo/tools/restore.cpp @@ -249,13 +249,8 @@ public: ns += _db; } else { - string dir = root.branch_path().string(); - if ( dir.find( "/" ) == string::npos ) - ns += dir; - else - ns += dir.substr( dir.find_last_of( "/" ) + 1 ); - - if ( ns.size() == 0 ) + ns = root.parent_path().filename().string(); + if (ns.empty()) ns = "test"; } |