Fix a bug where directory names of length one or less where not set

properly (examples: "", ".", "a").

llvm-svn: 18883
This commit is contained in:
Alkis Evlogimenos 2004-12-13 07:41:35 +00:00
parent c6de5b56a3
commit 5b1a05fb7c
1 changed files with 1 additions and 1 deletions

View File

@ -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;