From c7c26b047919b8f365b7fa79a958812ca2f77a01 Mon Sep 17 00:00:00 2001 From: Tomas Janousek Date: Sun, 15 Nov 2020 16:38:12 +0000 Subject: Fix crash on x when no additional fonts are specified This fixes the following crash that happens with the default xmobar configuration (using HOME=/ makes xmobar ignore ~/.xmobarrc): $ echo "x" | HOME=/ xmobar xmobar: Prelude.!!: index too large Commit 3e9e1cb9d300 ("Fix crashes/busy looping happening via index") meant to fix this but apparently it only fixed indexing of fontlist, not voffs, so the crash was still there. Fixes: https://github.com/jaor/xmobar/issues/504 --- src/Xmobar/App/Main.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Xmobar/App/Main.hs') diff --git a/src/Xmobar/App/Main.hs b/src/Xmobar/App/Main.hs index 03a01a1..b2bdc5c 100644 --- a/src/Xmobar/App/Main.hs +++ b/src/Xmobar/App/Main.hs @@ -63,7 +63,7 @@ xmobar conf = withDeferSignals $ do let ic = Map.empty to = textOffset conf ts = textOffsets conf ++ replicate (length fl) (-1) - startLoop (XConf d r w (fs :| fl) (to:ts) ic conf) sig refLock vars + startLoop (XConf d r w (fs :| fl) (to :| ts) ic conf) sig refLock vars configFromArgs :: Config -> IO Config configFromArgs cfg = getArgs >>= getOpts >>= doOpts cfg . fst -- cgit v1.2.3