From cac41719d3fb1640a2d43862afe6e85b88d26b95 Mon Sep 17 00:00:00 2001
From: Gregor Kleen <gkleen@yggdrasil.li>
Date: Thu, 2 Jun 2016 02:47:52 +0200
Subject: filename not dir

---
 ymir/mlmmj-expose.nix | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'ymir')

diff --git a/ymir/mlmmj-expose.nix b/ymir/mlmmj-expose.nix
index 3f4298cb..53e18b1d 100644
--- a/ymir/mlmmj-expose.nix
+++ b/ymir/mlmmj-expose.nix
@@ -61,7 +61,7 @@ let
           "mlmmj-get-exposed" -> do
             args <- getArgs
             case args of
-              listDir : (map toLower -> ident) : (map (map toLower) -> recipients) -> do
+              (dropTrailingPathSeparator -> listDir) : (map toLower -> ident) : (map (map toLower) -> recipients) -> do
                 setCurrentDirectory listDir
                 key <- (BS.readFile "exposed.key") `catchIOError` (\e -> if isDoesNotExistError e then randomKey >>= (\k -> BS.writeFile "exposed.key" k >> return k) else ioError e)
                 identities <- (lines <$> readFile "exposed.ids") `catchIOError` (\e -> if isDoesNotExistError e then return [] else ioError e)
@@ -69,7 +69,7 @@ let
                 subscribers <- getSubscribers
                 forM_ recipients (\recipient -> do {
                   unless (recipient `elem` subscribers) . die $ "Unknown recipient: ‘" ++ recipient ++ "’";
-                  encryptMsg CBC key (CLBS.pack . show $ (ident, recipient)) >>= putStrLn . (\ext -> takeDirectory listDir ++ "+" ++ ext ++ "@subs.lists.yggdrasil.li") . CBS.unpack . massage . Base64.encode . LBS.toStrict;
+                  encryptMsg CBC key (CLBS.pack . show $ (ident, recipient)) >>= putStrLn . (\ext -> takeFileName listDir ++ "+" ++ ext ++ "@subs.lists.yggdrasil.li") . CBS.unpack . massage . Base64.encode . LBS.toStrict;
                 })
               _ -> hPutStrLn stderr ("Called without expected arguments (<listDirectory> <senderIdentity> [<recipient> [...]])") >> exitWith (ExitFailure 2)
           _ -> hPutStrLn stderr ("Called under unsupported name ‘" ++ progName ++ "’") >> exitWith (ExitFailure 2)
-- 
cgit v1.2.3