mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
core: size parser treat 000 as decimal
This commit is contained in:
committed by
Sylvestre Ledru
parent
8ef926c6e8
commit
0465553f6e
@@ -197,7 +197,8 @@ impl<'parser> Parser<'parser> {
|
||||
.take_while(|c| c.is_ascii_digit())
|
||||
.collect::<String>()
|
||||
.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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user