mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibC: Pass the environment as third argument to main()
After some very confused debugging, I discovered that GNU make has a
main() function with this signature:
int main(int argc, char** argv, char** envp)
Apparently this is a non-standard but widely supported thing, so let's
do the same in Serenity so make works as expected.
This fixes an issue where you had to do "make PATH=..." instead of make
just picking up PATH from the environment. :^)
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
int main(int, char**);
|
||||
int main(int, char**, char**);
|
||||
|
||||
__thread int errno;
|
||||
char** environ;
|
||||
@@ -36,7 +36,7 @@ int _start(int argc, char** argv, char** env)
|
||||
for (size_t i = 0; i < size; i++)
|
||||
(*__init_array_start[i])(argc, argv, env);
|
||||
|
||||
int status = main(argc, argv);
|
||||
int status = main(argc, argv, environ);
|
||||
|
||||
exit(status);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user