summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authordaniel <daniel@wagner-home.com>2009-01-25 17:47:24 +0100
committerdaniel <daniel@wagner-home.com>2009-01-25 17:47:24 +0100
commit56f3676bafd911686364d6a7c6d1155e8c423252 (patch)
treeea88fe815ed9207e4ace60a9217d0f9309c3bd98
parent67f08e3e6460a9a38f30cadf3beb433460af5bed (diff)
downloadxmobar-56f3676bafd911686364d6a7c6d1155e8c423252.tar.gz
xmobar-56f3676bafd911686364d6a7c6d1155e8c423252.tar.bz2
handle successful commands with empty output
Ignore-this: dbf3cac5cd8130bdf186e3487e5915ce darcs-hash:20090125164724-c98ca-24f6b13ccacc41c07a029b5b0e817307069b145b.gz
-rw-r--r--Commands.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/Commands.hs b/Commands.hs
index 93f7572..bdc8d60 100644
--- a/Commands.hs
+++ b/Commands.hs
@@ -23,7 +23,9 @@ module Commands
, tenthSeconds
) where
+import Prelude hiding (catch)
import Control.Concurrent
+import Control.Exception
import Data.Char
import System.Process
import System.Exit
@@ -65,7 +67,7 @@ instance Exec Command where
hClose e
case exit of
ExitSuccess -> do
- str <- hGetLineSafe o
+ str <- catch (hGetLineSafe o) (\eof -> return "")
closeHandles
cb str
_ -> do closeHandles