diff options
author | Rob Landley <rob@landley.net> | 2014-09-27 19:58:18 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2014-09-27 19:58:18 -0500 |
commit | dc1af185e73410c5cad997c600678c212262a13c (patch) | |
tree | 43b8dff99d6607f726dd47b56965779da8bc1128 /main.c | |
parent | e0d8009d76b3a2451cb6c6ed2b241c7eff06ed60 (diff) | |
download | toybox-dc1af185e73410c5cad997c600678c212262a13c.tar.gz toybox-dc1af185e73410c5cad997c600678c212262a13c.tar.bz2 toybox-dc1af185e73410c5cad997c600678c212262a13c.zip |
Don't segfault for --help of single.sh build of OLDTOY commands that use another command's help.
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -26,6 +26,8 @@ struct toy_list *toy_find(char *name) { int top, bottom, middle; + if (!CFG_TOYBOX) return 0; + // If the name starts with "toybox" accept that as a match. Otherwise // skip the first entry, which is out of order. @@ -69,7 +71,7 @@ static void toy_singleinit(struct toy_list *which, char *argv[]) if (CFG_TOYBOX_I18N) setlocale(LC_ALL, "C"+!!(which->flags & TOYFLAG_LOCALE)); if (CFG_TOYBOX_HELP_DASHDASH && argv[1] && !strcmp(argv[1], "--help")) { - if (toys.which == toy_list && toys.argv[2]) + if (CFG_TOYBOX && toys.which == toy_list && toys.argv[2]) if (!(toys.which = toy_find(toys.argv[2]))) return; show_help(); xexit(); |