diff options
author | Alkis Evlogimenos <alkis@evlogimenos.com> | 2004-12-13 07:41:35 +0000 |
---|---|---|
committer | Alkis Evlogimenos <alkis@evlogimenos.com> | 2004-12-13 07:41:35 +0000 |
commit | 07941b493dfeb11996690cfa2fc14c7c0bd7bb91 (patch) | |
tree | 6f07cc47ec9ab85032c010775247c99b6b3f9565 /lib/System/Unix/Path.cpp | |
parent | b8e7df3937fca6e9a2ff424708eca40ca1a58dd0 (diff) |
Fix a bug where directory names of length one or less where not set
properly (examples: "", ".", "a").
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18883 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System/Unix/Path.cpp')
-rw-r--r-- | lib/System/Unix/Path.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/System/Unix/Path.cpp b/lib/System/Unix/Path.cpp index e655ef40cd..4b5ccb9344 100644 --- a/lib/System/Unix/Path.cpp +++ b/lib/System/Unix/Path.cpp @@ -290,7 +290,7 @@ Path::setDirectory(const std::string& a_path) { Path save(*this); path = a_path; size_t last = a_path.size() -1; - if (last != 0 && a_path[last] != '/') + if (a_path.size() == 0 || a_path[last] != '/') path += '/'; if (!isValid()) { path = save.path; |