-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement getEnv and getEnvironment #232
Conversation
@Mistuke this is ready for review |
It's possible this needs some adjustment to work across different GHCs (as in filepath/os-string versions). |
Should be fixed |
Sorry was on holidays! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Sorry for the slow review.
wNUL :: CWchar | ||
wNUL = 0 | ||
|
||
cWcharsToChars :: [CWchar] -> [Char] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
guess we could use decodeMultiByte
here. but this works too as it's always UTF-16.
Anything left to do here? |
OsString
variantSee haskell/filepath#221
base/ghc implementations: https://hackage.haskell.org/package/ghc-internal-9.1001.0/docs/src//GHC.Internal.System.Environment.html
Base runs two calls to
c_GetEnvironmentVariable
to get a more accurate allocation. But it's an additional call.