diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-02-12 10:12:18 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-02-12 10:12:18 +0000 |
commit | fee2d0c2567f9fad6a0a278b4598053a41180012 (patch) | |
tree | 435bf9472feea25781b11930d2a328b2debf951d | |
parent | 7e497527ea2edf0d75c9de243ba8202eaf87ee9d (diff) | |
download | busybox-w32-fee2d0c2567f9fad6a0a278b4598053a41180012.tar.gz busybox-w32-fee2d0c2567f9fad6a0a278b4598053a41180012.tar.bz2 busybox-w32-fee2d0c2567f9fad6a0a278b4598053a41180012.zip |
msh: stop trying to parse variables in "msh SCRIPT VAR=val param".
They should be passed as ordinary parameters.
-rw-r--r-- | shell/msh.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/shell/msh.c b/shell/msh.c index ee54ef2d4..65556043d 100644 --- a/shell/msh.c +++ b/shell/msh.c | |||
@@ -5337,19 +5337,22 @@ int msh_main(int argc, char **argv) | |||
5337 | 5337 | ||
5338 | if (signal(SIGINT, SIG_IGN) != SIG_IGN) | 5338 | if (signal(SIGINT, SIG_IGN) != SIG_IGN) |
5339 | signal(SIGINT, onintr); | 5339 | signal(SIGINT, onintr); |
5340 | |||
5341 | /* Handle "msh SCRIPT VAR=val params..." */ | ||
5342 | /* Disabled: bash does not do it! */ | ||
5343 | #if 0 | ||
5344 | argv++; | ||
5345 | /* skip leading args of the form VAR=val */ | ||
5346 | while (*argv && assign(*argv, !COPYV)) { | ||
5347 | argc--; | ||
5348 | argv++; | ||
5349 | } | ||
5350 | argv--; | ||
5351 | #endif | ||
5340 | dolv = argv; | 5352 | dolv = argv; |
5341 | dolc = argc; | 5353 | dolc = argc; |
5342 | dolv[0] = name; | 5354 | dolv[0] = name; |
5343 | if (dolc > 1) { | 5355 | |
5344 | for (ap = ++argv; --argc > 0;) { | ||
5345 | *ap = *argv++; | ||
5346 | if (assign(*ap, !COPYV)) { | ||
5347 | dolc--; /* keyword */ | ||
5348 | } else { | ||
5349 | ap++; | ||
5350 | } | ||
5351 | } | ||
5352 | } | ||
5353 | setval(lookup("#"), putn((--dolc < 0) ? (dolc = 0) : dolc)); | 5356 | setval(lookup("#"), putn((--dolc < 0) ? (dolc = 0) : dolc)); |
5354 | 5357 | ||
5355 | DBGPRINTF(("MSH_MAIN: begin FOR loop, interactive %d, global_env.iop %p, iostack %p\n", interactive, global_env.iop, iostack)); | 5358 | DBGPRINTF(("MSH_MAIN: begin FOR loop, interactive %d, global_env.iop %p, iostack %p\n", interactive, global_env.iop, iostack)); |