mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-07 14:33:15 +00:00
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
This commit is contained in:
parent
b8e7df3937
commit
07941b493d
@ -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;
|
||||
|
@ -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…
x
Reference in New Issue
Block a user