Pass envp to crunched program's main() routines as some depend on it.
Note that crunchgen's stub .c programs already have the code to use it: "int _crunched_%s_stub(int argc, char **argv, char **envp)" "{return main(argc,argv,envp);}\" >%s_stub.c\n", Add $FreeBSD$ to allow the commit. Reviewed by: luigi MFC after: 3 days
This commit is contained in:
parent
32d273402d
commit
8f3548b29f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=101341
@ -22,6 +22,8 @@
|
||||
* Author: James da Silva, Systems Design and Analysis Group
|
||||
* Computer Science Department
|
||||
* University of Maryland at College Park
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
/*
|
||||
* crunched_main.c - main program for crunched binaries, it branches to a
|
||||
@ -41,7 +43,7 @@ struct stub {
|
||||
|
||||
extern struct stub entry_points[];
|
||||
|
||||
int main(int argc, char **argv)
|
||||
int main(int argc, char **argv, char **envp)
|
||||
{
|
||||
char *slash, *basename;
|
||||
struct stub *ep;
|
||||
@ -56,7 +58,7 @@ int main(int argc, char **argv)
|
||||
if(!strcmp(basename, ep->name)) break;
|
||||
|
||||
if(ep->name)
|
||||
return ep->f(argc, argv);
|
||||
return ep->f(argc, argv, envp);
|
||||
else {
|
||||
fprintf(stderr, "%s: %s not compiled in\n", EXECNAME, basename);
|
||||
crunched_usage();
|
||||
|
Loading…
Reference in New Issue
Block a user