aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-12-13 07:51:52 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-12-13 07:51:52 +0000
commitb0e1887014100939f8dfc334b077fee9ae5b47a1 (patch)
tree941b367f0e43ea646b7ab418e9cc3d0013f8c88c
parent3d595cba33a8b2f9c92bc7887078fc7d4b486559 (diff)
downloadexternal_llvm-b0e1887014100939f8dfc334b077fee9ae5b47a1.zip
external_llvm-b0e1887014100939f8dfc334b077fee9ae5b47a1.tar.gz
external_llvm-b0e1887014100939f8dfc334b077fee9ae5b47a1.tar.bz2
Fix a bug where "." or any single character file name doesn't get the
terminating / when setDirectory is called. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18886 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/System/Win32/Path.cpp2
-rw-r--r--lib/System/Win32/Path.inc2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/System/Win32/Path.cpp b/lib/System/Win32/Path.cpp
index 070ebb3..8201dd4 100644
--- a/lib/System/Win32/Path.cpp
+++ b/lib/System/Win32/Path.cpp
@@ -300,7 +300,7 @@ Path::setDirectory(const std::string& a_path) {
path = a_path;
FlipBackSlashes(path);
size_t last = a_path.size() -1;
- if (last != 0 && a_path[last] != '/')
+ if (a_path[last] != '/')
path += '/';
if (!isValid()) {
path = save.path;
diff --git a/lib/System/Win32/Path.inc b/lib/System/Win32/Path.inc
index 070ebb3..8201dd4 100644
--- a/lib/System/Win32/Path.inc
+++ b/lib/System/Win32/Path.inc
@@ -300,7 +300,7 @@ Path::setDirectory(const std::string& a_path) {
path = a_path;
FlipBackSlashes(path);
size_t last = a_path.size() -1;
- if (last != 0 && a_path[last] != '/')
+ if (a_path[last] != '/')
path += '/';
if (!isValid()) {
path = save.path;