summaryrefslogtreecommitdiff
path: root/applets/applets.c
diff options
context:
space:
mode:
authorDenis Vlasenko2007-04-12 12:27:32 +0000
committerDenis Vlasenko2007-04-12 12:27:32 +0000
commit831a20f51246cd8d54a246ba7e239a062eeb002c (patch)
tree4f3efe440c2db9df016a1aa3dc8d36eb89eb7a2a /applets/applets.c
parentc98c31783c062377d14b80735b056cf4c53c66e9 (diff)
downloadbusybox-831a20f51246cd8d54a246ba7e239a062eeb002c.zip
busybox-831a20f51246cd8d54a246ba7e239a062eeb002c.tar.gz
pass a copy of argv[i] to NOFORK applets (they may permute it etc).
set/save/restore more shared global variables whan call one applet from another
Diffstat (limited to 'applets/applets.c')
-rw-r--r--applets/applets.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/applets/applets.c b/applets/applets.c
index bbb545a..82a7eee 100644
--- a/applets/applets.c
+++ b/applets/applets.c
@@ -33,7 +33,7 @@
#if ENABLE_SHOW_USAGE && !ENABLE_FEATURE_COMPRESS_USAGE
/* Define usage_messages[] */
-static const char usage_messages[] =
+static const char usage_messages[] = ""
#define MAKE_USAGE
#include "usage.h"
#include "applets.h"
@@ -590,6 +590,10 @@ static int busybox_main(int argc, char **argv)
void run_current_applet_and_exit(int argc, char **argv)
{
+ /* Reinit some shared global data */
+ optind = 1;
+ xfunc_error_retval = EXIT_FAILURE;
+
applet_name = current_applet->name;
if (argc == 2 && !strcmp(argv[1], "--help"))
bb_show_usage();