1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

uucore(checksum): determine regex from full line, not trimmed

The full line will be matched against the selected regex anyway
This commit is contained in:
Dorian Péron 2024-10-18 23:57:08 +02:00
parent 3031874d22
commit 97b81a6685

View file

@ -307,9 +307,8 @@ fn determine_regex(lines: &[String]) -> Option<(Regex, bool)> {
];
for line in lines {
let line_trim = line.trim();
for (regex, is_algo_based) in &regexes {
if regex.is_match(line_trim) {
if regex.is_match(line) {
return Some((regex.clone(), *is_algo_based));
}
}