mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
Handle lowercase letters
This commit is contained in:
parent
968483bdf6
commit
4a7778caf1
1 changed files with 2 additions and 2 deletions
|
@ -191,8 +191,8 @@ fn parse_size(size: ~str) -> Result<(u64, TruncateMode), ()> {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if !err && size.char_at(size.len() - 1).is_alphabetic() {
|
if !err && size.char_at(size.len() - 1).is_alphabetic() {
|
||||||
number *= match size.char_at(size.len() - 1) {
|
number *= match size.char_at(size.len() - 1).to_ascii().to_upper().to_char() {
|
||||||
'B' => match size.char_at(size.len() - 2) {
|
'B' => match size.char_at(size.len() - 2).to_ascii().to_upper().to_char() {
|
||||||
'K' => 1000,
|
'K' => 1000,
|
||||||
'M' => 1000 * 1000,
|
'M' => 1000 * 1000,
|
||||||
'G' => 1000 * 1000 * 1000,
|
'G' => 1000 * 1000 * 1000,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue