From da9ea641e54b63d3d37d7c0f781a0ac4129ea0df Mon Sep 17 00:00:00 2001 From: Calle Wilund Date: Wed, 19 Aug 2015 13:34:20 +0200 Subject: [PATCH] Commitlog: Handle full paths in descriptor file name parse. --- db/commitlog/commitlog.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/commitlog/commitlog.cc b/db/commitlog/commitlog.cc index a5767c799f..f504265ca6 100644 --- a/db/commitlog/commitlog.cc +++ b/db/commitlog/commitlog.cc @@ -90,7 +90,7 @@ db::commitlog::descriptor::descriptor(sstring filename) : descriptor([filename]() { std::smatch m; // match both legacy and new version of commitlogs Ex: CommitLog-12345.log and CommitLog-4-12345.log. - std::regex rx(FILENAME_PREFIX + "((\\d+)(" + SEPARATOR + "\\d+)?)" + FILENAME_EXTENSION); + std::regex rx("(?:.*/)?" + FILENAME_PREFIX + "((\\d+)(" + SEPARATOR + "\\d+)?)" + FILENAME_EXTENSION); std::string sfilename = filename; if (!std::regex_match(sfilename, m, rx)) { throw std::runtime_error("Cannot parse the version of the file: " + filename);