mirror of
https://github.com/sheumann/hush.git
synced 2024-12-27 16:31:24 +00:00
Shaun Jackman writes: Newlib uses both __getopt_initialized and optind to track initialization of getopt()
This commit is contained in:
parent
9b9e5479e8
commit
dcc40b7ecc
16
shell/lash.c
16
shell/lash.c
@ -1277,11 +1277,17 @@ static int pseudo_exec(struct child_prog *child)
|
|||||||
name = child->argv[0];
|
name = child->argv[0];
|
||||||
|
|
||||||
{
|
{
|
||||||
char** argv_l=child->argv;
|
char** argv_l=child->argv;
|
||||||
int argc_l;
|
int argc_l;
|
||||||
for(argc_l=0;*argv_l!=NULL; argv_l++, argc_l++);
|
#ifdef _NEWLIB_VERSION
|
||||||
optind = 1;
|
/* newlib uses __getopt_initialized for getopt() in
|
||||||
run_applet_by_name(name, argc_l, child->argv);
|
* addition to optind, see newlib/libc/sys/linux/getopt.c
|
||||||
|
*/
|
||||||
|
extern int __getopt_initialized = 0;
|
||||||
|
#endif
|
||||||
|
for(argc_l=0;*argv_l!=NULL; argv_l++, argc_l++);
|
||||||
|
optind = 1;
|
||||||
|
run_applet_by_name(name, argc_l, child->argv);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user