From 5a8f9a452c344761d57d25e4ddea16adc9e2f2c9 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sat, 11 Dec 2010 21:49:21 +0100 Subject: MBox: negative count for non-existent mboxes --- Plugins/MBox.hs | 4 ++-- 1 file 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 -- cgit v1.2.3