aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2013-01-05 00:44:24 -0600
committerRob Landley <rob@landley.net>2013-01-05 00:44:24 -0600
commit41ed9793498916c63d375326ea8c9b3fa1479dd6 (patch)
tree85cbe885f586ac1c0402b3bf3b3b3e7f7afa618b /main.c
parent90e8605ea587c4ebd00de77e3c71551b6e26b7c0 (diff)
downloadtoybox-41ed9793498916c63d375326ea8c9b3fa1479dd6.tar.gz
Use basename() where appropriate.
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().)