X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=System%2FEnvironment.hs;h=b85bc42e5e0c1a104780b60e19b7ac1b711e6a43;hb=4dc0a6fa50f56444c76e84387a16b179df2549ee;hp=4b329870d16a90a689123c670cd59098ffed3c4a;hpb=31a5a33a246738fbaaef90e7c6f2b42ce3cfe135;p=ghc-base.git diff --git a/System/Environment.hs b/System/Environment.hs index 4b32987..b85bc42 100644 --- a/System/Environment.hs +++ b/System/Environment.hs @@ -34,7 +34,8 @@ import Foreign import Foreign.C import Control.Exception.Base ( bracket ) import Control.Monad -import GHC.IOBase +-- import GHC.IO +import GHC.IO.Exception #endif #ifdef __HUGS__ @@ -123,7 +124,7 @@ getEnv name = if litstring /= nullPtr then peekCString litstring else ioException (IOError Nothing NoSuchThing "getEnv" - "no environment variable" (Just name)) + "no environment variable" Nothing (Just name)) foreign import ccall unsafe "getenv" c_getenv :: CString -> IO (Ptr CChar) @@ -154,7 +155,8 @@ withArgv new_args act = do pName <- System.Environment.getProgName existing_args <- System.Environment.getArgs bracket (setArgs new_args) - (\argv -> do setArgs (pName:existing_args); freeArgv argv) + (\argv -> do _ <- setArgs (pName:existing_args) + freeArgv argv) (const act) freeArgv :: Ptr CString -> IO ()