Options::wal_dir shouldn't end in '/'

Summary: If a client specifies wal_dir with trailing '/', we will fail in deleting obsolete log files. See task #4083746

Test Plan: make check

Reviewers: haobo, sdong

Reviewed By: haobo

CC: leveldb

Differential Revision: https://reviews.facebook.net/D17535
This commit is contained in:
Igor Canadi 2014-04-07 10:25:38 -07:00
parent f01a04ea2d
commit 7efdd9ef4d

View File

@ -322,6 +322,9 @@ Options SanitizeOptions(const std::string& dbname,
// Use dbname as default
result.wal_dir = dbname;
}
if (result.wal_dir.back() == '/') {
result.wal_dir = result.wal_dir.substr(result.wal_dir.size() - 1);
}
// -- Sanitize the table properties collector
// All user defined properties collectors will be wrapped by