forked from OSchip/llvm-project
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:
parent
c6de5b56a3
commit
5b1a05fb7c
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue