This commit is contained in:
Joey Hess 2011-08-30 13:23:21 -04:00
parent 5ef11350aa
commit a64c16bf7d
2 changed files with 4 additions and 6 deletions

View file

@ -137,8 +137,7 @@ compareSizes units abbrev old new
{- Parses strings like "10 kilobytes" or "0.5tb". -}
readSize :: [Unit] -> String -> Maybe ByteSize
readSize units input
| null parsednum = Nothing
| null parsedunit = Nothing
| null parsednum || null parsedunit = Nothing
| otherwise = Just $ round $ number * fromIntegral multiplier
where
(number, rest) = head parsednum