aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/main.c b/main.c
index bf89ef21..9370efd3 100644
--- a/main.c
+++ b/main.c
@@ -146,16 +146,8 @@ int main(int argc, char *argv[])
{
if (CFG_TOYBOX_I18N) setlocale(LC_ALL, "");
- // Artificial scope to eat less stack for things we call
- {
- char *name;
-
- // Trim path off of command name
- name = strrchr(argv[0], '/');
- if (!name) name=argv[0];
- else name++;
- argv[0] = name;
- }
+ // Trim path off of command name
+ *argv = basename(*argv);
// Call the multiplexer, adjusting this argv[] to be its' argv[1].
// (It will adjust it back before calling toy_exec().)