1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-30 12:37:49 +00:00

core: size parser treat 000 as decimal

This commit is contained in:
John Shin 2023-05-30 00:27:09 -07:00
parent af528ba84e
commit aed8a5759a

View file

@ -197,7 +197,8 @@ impl<'parser> Parser<'parser> {
.take_while(|c| c.is_ascii_digit()) .take_while(|c| c.is_ascii_digit())
.collect::<String>() .collect::<String>()
.len(); .len();
if size.starts_with('0') && num_digits > 1 { let all_zeros = size.chars().all(|c| c == '0');
if size.starts_with('0') && num_digits > 1 && !all_zeros {
return NumberSystem::Octal; return NumberSystem::Octal;
} }