From 739bab0be75c427bd366d4caf04f5e9352fb065c Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 27 Jan 2016 17:18:31 +0100 Subject: [PATCH] Trivia --- src/libutil/util.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libutil/util.cc b/src/libutil/util.cc index 16d32967b..def0525ab 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); }