diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-12-11 21:49:21 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-12-11 21:49:21 +0100 |
commit | 5a8f9a452c344761d57d25e4ddea16adc9e2f2c9 (patch) | |
tree | ed2656fcba64b36271baf8f48a74033d4768bb78 | |
parent | 4b26940ed310b9d7119eaf83c18526eb5ec38cd5 (diff) | |
download | xmobar-5a8f9a452c344761d57d25e4ddea16adc9e2f2c9.tar.gz xmobar-5a8f9a452c344761d57d25e4ddea16adc9e2f2c9.tar.bz2 |
MBox: negative count for non-existent mboxes
-rw-r--r-- | Plugins/MBox.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Plugins/MBox.hs b/Plugins/MBox.hs index f24fa1c..6fd63c8 100644 --- a/Plugins/MBox.hs +++ b/Plugins/MBox.hs @@ -88,13 +88,13 @@ instance Exec MBox where forM_ (zip xfs vs) $ \(f, v) -> do exists <- doesFileExist f - n <- if exists then countMails f else return 0 + n <- if exists then countMails f else return (-1) atomically $ writeTVar v (f, n) when exists $ addWatch i ev f (handleNotification v) >> return () changeLoop (mapM (fmap snd . readTVar) vs) $ \ns -> let s = unwords [ showC uniq m n c | (m, n, c) <- zip3 ts ns cs - , allb || n /= 0 ] + , allb || n > 0 ] in cb (if null s then "" else pref ++ s ++ suff) showC :: Bool -> String -> Int -> String -> String |