Don't ignore '\' characters when '/' isn't present in file names
This commit is contained in:
parent
6bb6fa4dda
commit
cf6e5cfaf8
|
@ -50,16 +50,16 @@ int main(int argc, char* argv[]) {
|
||||||
} catch (const Yerbacon::Exception& error) {
|
} catch (const Yerbacon::Exception& error) {
|
||||||
unsigned long lastSlash = 0;
|
unsigned long lastSlash = 0;
|
||||||
unsigned long position1 = fileName.find_last_of('/');
|
unsigned long position1 = fileName.find_last_of('/');
|
||||||
if (cmp_not_equal(position1, string_view::npos)) {
|
|
||||||
if constexpr(filesystem::path::preferred_separator == '/') {
|
if constexpr(filesystem::path::preferred_separator == '/') {
|
||||||
|
if (cmp_not_equal(position1, string_view::npos)) {
|
||||||
lastSlash = position1;
|
lastSlash = position1;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
unsigned long position2 = fileName.find_last_of(filesystem::path::preferred_separator);
|
unsigned long position2 = fileName.find_last_of(filesystem::path::preferred_separator);
|
||||||
if (cmp_not_equal(position2, string_view::npos)) {
|
if (cmp_not_equal(position2, string_view::npos)) {
|
||||||
lastSlash = max(position1, position2);
|
lastSlash = max(position1, position2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
resultingPair.first = fileName.substr(lastSlash + 1);
|
resultingPair.first = fileName.substr(lastSlash + 1);
|
||||||
resultingPair.second.emplace(error);
|
resultingPair.second.emplace(error);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue