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:
parent
c5434e0cfa
commit
b2dd12daac
4 changed files with 59 additions and 47 deletions
|
@ -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();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue