aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2018-11-05 13:13:08 +0000
committerDenys Vlasenko <vda.linux@googlemail.com>2018-11-06 08:49:11 +0100
commit8767c12774d9392565f20d3ea4e28bb1b6075a31 (patch)
treebbafe8f27680733f1db7e83dd43d55e62c1437ef
parent084bac472b02f307a093f56a262312accd6fb014 (diff)
downloadbusybox-w32-8767c12774d9392565f20d3ea4e28bb1b6075a31.tar.gz
busybox-w32-8767c12774d9392565f20d3ea4e28bb1b6075a31.tar.bz2
busybox-w32-8767c12774d9392565f20d3ea4e28bb1b6075a31.zip
ash: minor fixes
Ensure that login_sh is initialised in procargs even when running an embedded script. The argc argument to ash_main isn't unused when embedded scripts are present. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--shell/ash.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 88f2b5bd6..90eaf6faf 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -14052,11 +14052,11 @@ procargs(char **argv)
14052 int login_sh; 14052 int login_sh;
14053 14053
14054 xargv = argv; 14054 xargv = argv;
14055 login_sh = xargv[0] && xargv[0][0] == '-';
14055#if NUM_SCRIPTS > 0 14056#if NUM_SCRIPTS > 0
14056 if (minusc) 14057 if (minusc)
14057 goto setarg0; 14058 goto setarg0;
14058#endif 14059#endif
14059 login_sh = xargv[0] && xargv[0][0] == '-';
14060 arg0 = xargv[0]; 14060 arg0 = xargv[0];
14061 /* if (xargv[0]) - mmm, this is always true! */ 14061 /* if (xargv[0]) - mmm, this is always true! */
14062 xargv++; 14062 xargv++;
@@ -14164,7 +14164,11 @@ extern int etext();
14164 * is used to figure out how far we had gotten. 14164 * is used to figure out how far we had gotten.
14165 */ 14165 */
14166int ash_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 14166int ash_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
14167#if NUM_SCRIPTS > 0
14168int ash_main(int argc, char **argv)
14169#else
14167int ash_main(int argc UNUSED_PARAM, char **argv) 14170int ash_main(int argc UNUSED_PARAM, char **argv)
14171#endif
14168/* note: 'argc' is used only if embedded scripts are enabled */ 14172/* note: 'argc' is used only if embedded scripts are enabled */
14169{ 14173{
14170 volatile smallint state; 14174 volatile smallint state;