summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2020-05-19 19:38:59 +0100
committerjao <jao@gnu.org>2020-05-19 19:38:59 +0100
commitb15bb7c20b11a9f148c4757caba7167ee66492fc (patch)
treef8e36a421271a56581feac0a877813501fb0e436
parented0663aac942113a693e225dbacaa69784017976 (diff)
downloadxmobar-b15bb7c20b11a9f148c4757caba7167ee66492fc.tar.gz
xmobar-b15bb7c20b11a9f148c4757caba7167ee66492fc.tar.bz2
hlinting
-rw-r--r--src/Xmobar/Plugins/StdinReader.hs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Xmobar/Plugins/StdinReader.hs b/src/Xmobar/Plugins/StdinReader.hs
index 8c0c0bf..a29c1ad 100644
--- a/src/Xmobar/Plugins/StdinReader.hs
+++ b/src/Xmobar/Plugins/StdinReader.hs
@@ -25,6 +25,7 @@ import System.IO
import Xmobar.Run.Exec
import Xmobar.X11.Actions (stripActions)
import Xmobar.System.Utils (onSomeException)
+import Control.Monad (when)
data StdinReader = StdinReader | UnsafeStdinReader
deriving (Read, Show)
@@ -34,11 +35,9 @@ instance Exec StdinReader where
-- The EOF check is necessary for certain systems
-- More details here https://github.com/jaor/xmobar/issues/442
eof <- isEOF
- if eof
- then do
- hPrint stderr $ "xmobar: eof at an early stage"
- exitImmediately ExitSuccess
- else return ()
+ when eof $
+ do hPrint stderr "xmobar: eof at an early stage"
+ exitImmediately ExitSuccess
s <-
getLine `onSomeException`
(\e -> do