aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorvapier <vapier@69ca8d6d-28ef-0310-b511-8ec308f3f277>2005-03-04 01:33:17 +0000
committervapier <vapier@69ca8d6d-28ef-0310-b511-8ec308f3f277>2005-03-04 01:33:17 +0000
commit113675dd71676613a45444e01e08ee047a66fefe (patch)
treea78b573197933a69b70adbe6225d9feffae96316 /shell
parent8d65a8ae5dd92018cd7928f4ff84bc007b4865cd (diff)
downloadbusybox-w32-113675dd71676613a45444e01e08ee047a66fefe.tar.gz
busybox-w32-113675dd71676613a45444e01e08ee047a66fefe.tar.bz2
busybox-w32-113675dd71676613a45444e01e08ee047a66fefe.zip
Shaun Jackman writes: Newlib uses both __getopt_initialized and optind to track initialization of getopt()
git-svn-id: svn://busybox.net/trunk/busybox@9972 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'shell')
-rw-r--r--shell/lash.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/shell/lash.c b/shell/lash.c
index f454e6990..c4655acd8 100644
--- a/shell/lash.c
+++ b/shell/lash.c
@@ -1277,11 +1277,17 @@ static int pseudo_exec(struct child_prog *child)
1277 name = child->argv[0]; 1277 name = child->argv[0];
1278 1278
1279 { 1279 {
1280 char** argv_l=child->argv; 1280 char** argv_l=child->argv;
1281 int argc_l; 1281 int argc_l;
1282 for(argc_l=0;*argv_l!=NULL; argv_l++, argc_l++); 1282#ifdef _NEWLIB_VERSION
1283 optind = 1; 1283 /* newlib uses __getopt_initialized for getopt() in
1284 run_applet_by_name(name, argc_l, child->argv); 1284 * addition to optind, see newlib/libc/sys/linux/getopt.c
1285 */
1286 extern int __getopt_initialized = 0;
1287#endif
1288 for(argc_l=0;*argv_l!=NULL; argv_l++, argc_l++);
1289 optind = 1;
1290 run_applet_by_name(name, argc_l, child->argv);
1285 } 1291 }
1286#endif 1292#endif
1287 1293