diff options
author | Andrea Rossato <andrea.rossato@ing.unitn.it> | 2007-07-24 11:27:01 +0200 |
---|---|---|
committer | Andrea Rossato <andrea.rossato@ing.unitn.it> | 2007-07-24 11:27:01 +0200 |
commit | a002121921c5c68956b3785c3d2a1f62f7f4752b (patch) | |
tree | a16cc5d0bead384cc43b59866c0603e92d233363 /Plugins/Monitors/Common.hs | |
parent | 2b6df4ff82e2dfb88f1dc781c31ed6d5b83c5d38 (diff) | |
download | xmobar-a002121921c5c68956b3785c3d2a1f62f7f4752b.tar.gz xmobar-a002121921c5c68956b3785c3d2a1f62f7f4752b.tar.bz2 |
Monitors.Common: parseString will not produce exceptions anymore
An empty string will be returned instead.
darcs-hash:20070724092701-d6583-aa7c76ce3c38f93415c05b5afd86618b4aad6f71.gz
Diffstat (limited to 'Plugins/Monitors/Common.hs')
-rw-r--r-- | Plugins/Monitors/Common.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Plugins/Monitors/Common.hs b/Plugins/Monitors/Common.hs index d2ae8c3..53374d2 100644 --- a/Plugins/Monitors/Common.hs +++ b/Plugins/Monitors/Common.hs @@ -253,7 +253,9 @@ floatToPercent n = stringParser :: Pos -> B.ByteString -> String stringParser (x,y) = - flip (!!) x . map B.unpack . B.words . flip (!!) y . B.lines + tk x . words . tk y . lines . B.unpack + where tk i l | length l >= i = flip (!!) i $ l + | otherwise = [] setColor :: String -> Selector (Maybe String) -> Monitor String setColor str s = |