@@ -149,7 +149,7 @@ writeDocx :: WriterOptions -- ^ Writer options
149149writeDocx opts doc@(Pandoc meta _) = do
150150 let datadir = writerUserDataDir opts
151151 let doc' = walk fixDisplayMath doc
152− username <- lookupEnv "USERNAME"
152+ username <- lookup "USERNAME" <$> getEnvironment
153153 utctime <- getCurrentTime
154154 refArchive <- liftM (toArchive . toLazy) $
155155 case writerReferenceDocx opts of