From 56f3676bafd911686364d6a7c6d1155e8c423252 Mon Sep 17 00:00:00 2001 From: daniel Date: Sun, 25 Jan 2009 17:47:24 +0100 Subject: handle successful commands with empty output Ignore-this: dbf3cac5cd8130bdf186e3487e5915ce darcs-hash:20090125164724-c98ca-24f6b13ccacc41c07a029b5b0e817307069b145b.gz --- Commands.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3