diff options
author | Rob Landley <rob@landley.net> | 2013-01-05 00:44:24 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2013-01-05 00:44:24 -0600 |
commit | 41ed9793498916c63d375326ea8c9b3fa1479dd6 (patch) | |
tree | 85cbe885f586ac1c0402b3bf3b3b3e7f7afa618b /main.c | |
parent | 90e8605ea587c4ebd00de77e3c71551b6e26b7c0 (diff) | |
download | toybox-41ed9793498916c63d375326ea8c9b3fa1479dd6.tar.gz |
Use basename() where appropriate.
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 12 |
1 files changed, 2 insertions, 10 deletions
@@ -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().) |