diff options
author | 2016-07-12 13:09:42 +1000 | |
---|---|---|
committer | 2016-07-12 13:09:42 +1000 | |
commit | 31c4a813698b8aba24036efb80c09101d0a8694e (patch) | |
tree | cf9abfabd3eadbf9cf79d51939872b0be40af138 /src/lib/util/corefile.cpp | |
parent | 203c8ffbdbaa9046cde09af1d6355d202cbe0341 (diff) |
misc fixes (nw)
* remove a temporary
* fix deps
* remove a vestigial member
* play nicer with dotfiles
* play nicer with pch
Diffstat (limited to 'src/lib/util/corefile.cpp')
-rw-r--r-- | src/lib/util/corefile.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/util/corefile.cpp b/src/lib/util/corefile.cpp index c06426015f7..7a34406cf02 100644 --- a/src/lib/util/corefile.cpp +++ b/src/lib/util/corefile.cpp @@ -18,6 +18,8 @@ #include <algorithm> #include <cassert> #include <cstring> +#include <iterator> + #include <ctype.h> @@ -1279,13 +1281,12 @@ std::string core_filename_extract_base(const std::string &name, bool strip_exten auto const chop_position = strip_extension ? std::find(name.rbegin(), start, '.') : start; - auto const end = (chop_position != start) - ? chop_position + 1 + auto const end = ((chop_position != start) && (std::next(chop_position) != start)) + ? std::next(chop_position) : name.rbegin(); // copy the result into an string - std::string result(start.base(), end.base()); - return result; + return std::string(start.base(), end.base()); } |