diff options
author | Simon Marlow <simonmar@microsoft.com> | 2006-05-31 14:46:40 +0000 |
---|---|---|
committer | Simon Marlow <simonmar@microsoft.com> | 2006-05-31 14:46:40 +0000 |
commit | 9901c046b1ddbc6d88bbdc25f923db5c43e3844a (patch) | |
tree | 009227c5ff3ff1e90705b21c717ce70fd0034a7c /System | |
parent | d130c8bdf774b7be7b7e42094317a1cc172265b5 (diff) |
fix bogosity in getEnvironmentPrim
Diffstat (limited to 'System')
-rw-r--r-- | System/Posix/Env.hsc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/System/Posix/Env.hsc b/System/Posix/Env.hsc index ef7c3e0..f426f98 100644 --- a/System/Posix/Env.hsc +++ b/System/Posix/Env.hsc @@ -55,11 +55,12 @@ foreign import ccall unsafe "getenv" getEnvironmentPrim :: IO [String] getEnvironmentPrim = do - arr <- peekArray0 nullPtr c_environ_p + c_environ <- peek c_environ_p + arr <- peekArray0 nullPtr c_environ mapM peekCString arr foreign import ccall unsafe "&environ" - c_environ_p :: Ptr CString + c_environ_p :: Ptr (Ptr CString) -- |'getEnvironment' retrieves the entire environment as a -- list of @(key,value)@ pairs. |