diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-01-27T16·18+0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-01-27T16·18+0100 |
commit | 739bab0be75c427bd366d4caf04f5e9352fb065c (patch) | |
tree | ae724d0e683d83325ea5d1c457c88556d95bc6a7 /src | |
parent | d45ad8fcf5e79d95c55ed2185351d4e20d940cb2 (diff) |
Trivia
Diffstat (limited to 'src')
-rw-r--r-- | src/libutil/util.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc index 16d32967bb35..def0525abc18 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -150,7 +150,7 @@ Path dirOf(const Path & path) string baseNameOf(const Path & path) { if (path.empty()) - return string(""); + return ""; Path::size_type last = path.length() - 1; if (path[last] == '/' && last > 0) @@ -161,6 +161,7 @@ string baseNameOf(const Path & path) pos = 0; else pos += 1; + return string(path, pos, last - pos + 1); } |