Mercurial > hg > toybox
comparison lib/help.c @ 1501:c51a4dbe5db7 draft
Don't segfault for --help of single.sh build of OLDTOY commands that use another command's help.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sat, 27 Sep 2014 19:58:18 -0500 |
parents | c5e80c74ec6c |
children | 5fac2769a159 |
comparison
equal
deleted
inserted
replaced
1500:cf77c4939385 | 1501:c51a4dbe5db7 |
---|---|
23 for (;;) { | 23 for (;;) { |
24 s = help_data; | 24 s = help_data; |
25 while (i--) s += strlen(s) + 1; | 25 while (i--) s += strlen(s) + 1; |
26 // If it's an alias, restart search for real name | 26 // If it's an alias, restart search for real name |
27 if (*s != 255) break; | 27 if (*s != 255) break; |
28 if (!CFG_TOYBOX) { | |
29 s = xmprintf("See %s --help\n", ++s); | |
30 | |
31 break; | |
32 } | |
28 i = toy_find(++s)-toy_list; | 33 i = toy_find(++s)-toy_list; |
29 } | 34 } |
30 | 35 |
31 fprintf(toys.exithelp ? stderr : stdout, "%s", s); | 36 fprintf(toys.exithelp ? stderr : stdout, "%s", s); |
32 } | 37 } |