From aa7b3c28d48603bd641f048314ba621b093b325a Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 13 Dec 2016 18:50:25 +0300 Subject: bugfix --- src/Windows/Registry.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Windows/Registry.hs b/src/Windows/Registry.hs index 41275bf..9423205 100644 --- a/src/Windows/Registry.hs +++ b/src/Windows/Registry.hs @@ -133,8 +133,7 @@ decodeString (_, bytes) = T.unpack dropLastZero where text = decodeUtf16LE bytes dropLastZero | T.null text = text - | T.last text == '\0' = T.init text - | otherwise = text + | otherwise = T.dropWhileEnd (== '\0') text openCloseCatch :: IsKeyPath a => a -> (Handle -> IO b) -> ExceptT IOError IO b openCloseCatch keyPath f = ExceptT $ catchIOError (openApplyClose >>= return . Right) $ return . Left -- cgit v1.2.3