mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03: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:
parent
27321e9c44
commit
c74e4d0c80
Notes:
sideshowbarker
2024-07-19 12:08:53 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/c74e4d0c80c
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user