diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Xmobar/Plugins/StdinReader.hs | 9 | 
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 | 
