Browse Source

Fix broken code in ArgumentParser::printBashCompletion() leading to crashes

See https://github.com/Martchus/cpp-utilities/issues/19#issuecomment-839758443
charconv v5.10.3
Martchus 7 months ago
parent
commit
b22a600e77
  1. 2
      application/argumentparser.cpp

2
application/argumentparser.cpp

@ -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…
Cancel
Save