1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:37:35 +00:00

LibC: Change putenv (and getenv) to not copy, but directly return the environ values.

This is in keeping with how putenv should function. It does mean that
the shell's export command now leaks, but that's not a difficult fix.

Contributes to #29.
This commit is contained in:
Robin Burchell 2019-05-16 13:04:47 +02:00 committed by Andreas Kling
parent c5434e0cfa
commit b2dd12daac
4 changed files with 59 additions and 47 deletions

View file

@ -8,7 +8,7 @@ int main(int, char**);
int errno;
char** environ;
//bool __environ_is_malloced;
bool __environ_is_malloced;
void __libc_init()
{
@ -22,7 +22,7 @@ void __libc_init()
int _start(int argc, char** argv, char** env)
{
environ = env;
//__environ_is_malloced = false;
__environ_is_malloced = false;
__libc_init();