From: Matt Kraai Date: Wed, 4 Apr 2001 17:50:04 +0000 (-0000) Subject: Avoid segfault when export is invoked with no arguments. Thanks to X-Git-Tag: 0_51~51 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2129f97cd9502b731f6489e4c8be54fd44affc1d;p=oweals%2Fbusybox.git Avoid segfault when export is invoked with no arguments. Thanks to Gennady Feldman. --- diff --git a/lash.c b/lash.c index 28015cbb3..89325b63d 100644 --- a/lash.c +++ b/lash.c @@ -426,6 +426,7 @@ static int builtin_export(struct child_prog *child) for (e = environ; *e; e++) { printf( "%s\n", *e); } + return 0; } res = putenv(v); if (res) diff --git a/sh.c b/sh.c index 28015cbb3..89325b63d 100644 --- a/sh.c +++ b/sh.c @@ -426,6 +426,7 @@ static int builtin_export(struct child_prog *child) for (e = environ; *e; e++) { printf( "%s\n", *e); } + return 0; } res = putenv(v); if (res) diff --git a/shell/lash.c b/shell/lash.c index 28015cbb3..89325b63d 100644 --- a/shell/lash.c +++ b/shell/lash.c @@ -426,6 +426,7 @@ static int builtin_export(struct child_prog *child) for (e = environ; *e; e++) { printf( "%s\n", *e); } + return 0; } res = putenv(v); if (res)