aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/Windows/Registry.hs
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2016-12-13 18:50:25 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2016-12-13 18:50:25 +0300
commitaa7b3c28d48603bd641f048314ba621b093b325a (patch)
tree04ffe792613a9c9cca08ff020d5b749005bb19bb /src/Windows/Registry.hs
parentstack.yaml update (diff)
downloadwindows-env-aa7b3c28d48603bd641f048314ba621b093b325a.tar.gz
windows-env-aa7b3c28d48603bd641f048314ba621b093b325a.zip
bugfix
Diffstat (limited to 'src/Windows/Registry.hs')
-rw-r--r--src/Windows/Registry.hs3
1 files changed, 1 insertions, 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