Fix broken code in ArgumentParser::printBashCompletion() leading to crashes
See https://github.com/Martchus/cpp-utilities/issues/19#issuecomment-839758443
This commit is contained in:
parent
f549285fde
commit
b22a600e77
|
@ -1511,7 +1511,7 @@ void ArgumentParser::printBashCompletion(int argc, const char *const *argv, unsi
|
|||
if (file[0] == '\"' || file[0] == '\'') {
|
||||
file.erase(0, 1);
|
||||
}
|
||||
if (file.size() > 1 && (file[dir.size() - 2] == '\"' || dir[file.size() - 2] == '\'')) {
|
||||
if (file.size() > 1 && (file[file.size() - 2] == '\"' || file[file.size() - 2] == '\'')) {
|
||||
file.erase(file.size() - 2, 1);
|
||||
}
|
||||
actualFile = move(file);
|
||||
|
|
Loading…
Reference in New Issue