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
diff --git a/lib/System/Unix/Path.inc b/lib/System/Unix/Path.inc
index e655ef4..4b5ccb9 100644
--- a/lib/System/Unix/Path.inc
+++ b/lib/System/Unix/Path.inc
@@ -290,7 +290,7 @@
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;