summaryrefslogtreecommitdiff
path: root/Utility
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-08-30 13:23:21 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-08-30 13:23:21 -0400
commita64c16bf7d6cf3ba5295a23496e10ed70c1656dc (patch)
tree0992823d20075951b74bf37a782a36f312a56f92 /Utility
parent5ef11350aafe2aec48f66799743423a9c6e42556 (diff)
tweak
Diffstat (limited to 'Utility')
-rw-r--r--Utility/DataUnits.hs3
1 files changed, 1 insertions, 2 deletions
diff --git a/Utility/DataUnits.hs b/Utility/DataUnits.hs
index f2bc333ea..0baa5dd89 100644
--- a/Utility/DataUnits.hs
+++ b/Utility/DataUnits.hs
@@ -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