Commit ac5fd757 authored by Joey Hess's avatar Joey Hess
Browse files

use withFilePath for environment variables

withCString doesn't allow undecodable bytes to round-trip through the
program, so use withFilePath to pack the environment. (It was already
used for packing the arguments.)

parent f493eaa6
......@@ -93,7 +93,7 @@ translateInternal str
withCEnvironment :: [(String,String)] -> (Ptr CString -> IO a) -> IO a
withCEnvironment envir act =
let env' = map (\(name, val) -> name ++ ('=':val)) envir
in withMany withCString env' (\pEnv -> withArray0 nullPtr pEnv act)
in withMany withFilePath env' (\pEnv -> withArray0 nullPtr pEnv act)
-- -----------------------------------------------------------------------------
-- POSIX runProcess with signal handling in the child
......@@ -6,6 +6,9 @@
not being dropped when this was the user's intent) where the groups of the
spawning process's user would be incorrectly retained due to a missing call to
`initgroups` [#149].
* Bug fix: Prevent stripping undecodable bytes from environment variables
when in a non-unicode locale.
## *June 2019*
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment