summaryrefslogtreecommitdiff
path: root/db/mongommf.cpp
diff options
context:
space:
mode:
authordwight <dwight@10gen.com>2010-12-15 02:13:26 -0500
committerdwight <dwight@10gen.com>2010-12-15 10:42:50 -0500
commit6689861a0d69e10446aebe2d04229311ed00390c (patch)
tree8f07fe0a143e3796310740eb531195311d834285 /db/mongommf.cpp
parent576feea5bb3661c5cfae88836a0ebf02ef77f902 (diff)
downloadmongo-6689861a0d69e10446aebe2d04229311ed00390c.tar.gz
Revert "Revert "str stuff""
This reverts commit 0e3aed4922a0c16756e1101b3c2ba24d1a10d9dc.
Diffstat (limited to 'db/mongommf.cpp')
-rw-r--r--db/mongommf.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/db/mongommf.cpp b/db/mongommf.cpp
index 308b999d76c..3be78702e35 100644
--- a/db/mongommf.cpp
+++ b/db/mongommf.cpp
@@ -153,23 +153,15 @@ namespace mongo {
void MongoMMF::setPath(string f) {
string suffix;
- string fullpath;
- bool ok = str::rSplitOn(f, '.', fullpath, suffix);
+ string prefix;
+ bool ok = str::rSplitOn(f, '.', prefix, suffix);
uassert(13520, str::stream() << "MongoMMF only supports filenames in a certain format " << f, ok);
if( suffix == "ns" )
_fileSuffixNo = -1;
else
_fileSuffixNo = (int) str::toUnsigned(suffix);
- string relative = str::after(fullpath, dbpath);
- uassert(13600,
- str::stream() << "MongoMMF file path is not under the db path? " << fullpath << ' ' << dbpath,
- relative != fullpath);
-
- if( str::startsWith(relative, "/") || str::startsWith(relative, "\\") ) {
- relative.erase(0, 1);
- }
- _relativePath = relative;
+ _p = RelativePath::fromFullPath(prefix);
}
bool MongoMMF::open(string fname, bool sequentialHint) {