summaryrefslogtreecommitdiffstats
path: root/src/util.cc
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2011-04-22 17:45:42 (GMT)
committerEvan Martin <martine@danga.com>2011-04-22 17:45:42 (GMT)
commit7baaadce1182705754a1605fa25955ea9e8168f0 (patch)
tree580943dd4d0058463e8692309fd44903644cbf76 /src/util.cc
parent3e20ca8f25e914d3cb68fbda59692ebefdaf2251 (diff)
downloadNinja-7baaadce1182705754a1605fa25955ea9e8168f0.zip
Ninja-7baaadce1182705754a1605fa25955ea9e8168f0.tar.gz
Ninja-7baaadce1182705754a1605fa25955ea9e8168f0.tar.bz2
handle foo//bar in CanonicalizePath
Diffstat (limited to 'src/util.cc')
-rw-r--r--src/util.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/util.cc b/src/util.cc
index b68227b..e8fcc64 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -42,7 +42,8 @@ void Error(const char* msg, ...) {
bool CanonicalizePath(std::string* path, std::string* err) {
// Try to fast-path out the common case.
if (path->find("/.") == std::string::npos &&
- path->find("./") == std::string::npos) {
+ path->find("./") == std::string::npos &&
+ path->find("//") == std::string::npos) {
return true;
}
@@ -54,7 +55,8 @@ bool CanonicalizePath(std::string* path, std::string* err) {
end = inpath.size();
else
inpath[end] = 0;
- parts.push_back(inpath.data() + start);
+ if (end > start)
+ parts.push_back(inpath.data() + start);
start = end;
}