summaryrefslogtreecommitdiff
path: root/applets/busybox.c
diff options
context:
space:
mode:
authorMatt Kraai2000-07-11 20:03:24 +0000
committerMatt Kraai2000-07-11 20:03:24 +0000
commit7719008a85c69db66e2f948d6779b6a45352018d (patch)
treecc30d94c96cd1348ef27cd75c5697007ddb72277 /applets/busybox.c
parentaec27bca9840e132c2f067c23745f02bd3c7bb45 (diff)
downloadbusybox-7719008a85c69db66e2f948d6779b6a45352018d.zip
busybox-7719008a85c69db66e2f948d6779b6a45352018d.tar.gz
Added applet_name to contain the applet name.
Diffstat (limited to 'applets/busybox.c')
-rw-r--r--applets/busybox.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/applets/busybox.c b/applets/busybox.c
index 5471db5..218343b 100644
--- a/applets/busybox.c
+++ b/applets/busybox.c
@@ -354,6 +354,7 @@ const struct BB_applet applets[] = {
{0}
};
+const char *applet_name;
#ifdef BB_FEATURE_INSTALLER
/*
@@ -436,7 +437,6 @@ int uninstall_links() ?
int main(int argc, char **argv)
{
char *s;
- char *name;
const struct BB_applet *a = applets;
#ifdef BB_FEATURE_INSTALLER
@@ -469,12 +469,12 @@ int main(int argc, char **argv)
}
#endif /* BB_FEATURE_INSTALLER */
- for (s = name = argv[0]; *s != '\0';) {
+ for (s = applet_name = argv[0]; *s != '\0';) {
if (*s++ == '/')
- name = s;
+ applet_name = s;
}
- *argv = name;
+ *argv = applet_name;
#ifdef BB_SH
/* Add in a special case hack -- whenever **argv == '-'
@@ -484,7 +484,7 @@ int main(int argc, char **argv)
#endif
while (a->name != 0) {
- if (strcmp(name, a->name) == 0) {
+ if (strcmp(applet_name, a->name) == 0) {
exit(((*(a->main)) (argc, argv)));
}
a++;