Fix a bug where "." or any single character file name doesn't get the
authorReid Spencer <rspencer@reidspencer.com>
Mon, 13 Dec 2004 07:51:52 +0000 (07:51 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Mon, 13 Dec 2004 07:51:52 +0000 (07:51 +0000)
terminating / when setDirectory is called.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18886 91177308-0d34-0410-b5e6-96231b3b80d8

lib/System/Win32/Path.cpp
lib/System/Win32/Path.inc

index 070ebb312085ea80d7eb1db75725ce94e0f681cd..8201dd4ab22d66c7f6e972081cce6a1c563f9ec5 100644 (file)
@@ -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;
index 070ebb312085ea80d7eb1db75725ce94e0f681cd..8201dd4ab22d66c7f6e972081cce6a1c563f9ec5 100644 (file)
@@ -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;