summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar/Plugins/PipeReader.hs
diff options
context:
space:
mode:
authorSibi Prabakaran <sibi@psibi.in>2020-04-30 19:56:45 +0530
committerjao <jao@gnu.org>2020-04-30 16:45:31 +0100
commita705d021a8cfbb3b9bbfbec833302768d3ad459e (patch)
tree6d52eecacdc3d2536ac83a3c6e0ca8f3f0412bd2 /src/Xmobar/Plugins/PipeReader.hs
parentb0591c5e4c483aa47ef74ab25448c56cf6e3a82a (diff)
downloadxmobar-a705d021a8cfbb3b9bbfbec833302768d3ad459e.tar.gz
xmobar-a705d021a8cfbb3b9bbfbec833302768d3ad459e.tar.bz2
Refactor the usage of hGetLineSafe
hGetLineSafe is always hGetLine and hence we can directly use it.
Diffstat (limited to 'src/Xmobar/Plugins/PipeReader.hs')
-rw-r--r--src/Xmobar/Plugins/PipeReader.hs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/Xmobar/Plugins/PipeReader.hs b/src/Xmobar/Plugins/PipeReader.hs
index 9c6e628..1a10abf 100644
--- a/src/Xmobar/Plugins/PipeReader.hs
+++ b/src/Xmobar/Plugins/PipeReader.hs
@@ -16,7 +16,6 @@ module Xmobar.Plugins.PipeReader(PipeReader(..)) where
import System.IO
import Xmobar.Run.Exec(Exec(..))
-import Xmobar.System.Utils(hGetLineSafe)
import Xmobar.System.Environment(expandEnv)
import System.Posix.Files
import Control.Concurrent(threadDelay)
@@ -34,7 +33,7 @@ instance Exec PipeReader where
unless (null def) (cb def)
checkPipe pipe
h <- openFile pipe ReadWriteMode
- forever (hGetLineSafe h >>= cb)
+ forever (hGetLine h >>= cb)
where
split c xs | c `elem` xs = let (pre, post) = span (c /=) xs
in (pre, dropWhile (c ==) post)