aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2016-09-04 17:18:31 -0500
committerRob Landley <rob@landley.net>2016-09-04 17:18:31 -0500
commit0c8a66ea44eae5eec4d0398a1f2a6d93a54b0fb0 (patch)
tree55ebbc67873ae866fc4107d07132a8ffc8c9c1ad
parent7528a9628443b2d8e57b7bece698a5a6a0a3fe18 (diff)
downloadtoybox-0c8a66ea44eae5eec4d0398a1f2a6d93a54b0fb0.tar.gz
Switch help.c from #ifdef to if()
-rw-r--r--lib/help.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/lib/help.c b/lib/help.c
index 87a3df94..d0185678 100644
--- a/lib/help.c
+++ b/lib/help.c
@@ -2,9 +2,6 @@
#include "toys.h"
-#if !CFG_TOYBOX_HELP
-void show_help(FILE *out) {;}
-#else
#include "generated/help.h"
#undef NEWTOY
@@ -24,14 +21,15 @@ void show_help(FILE *out)
int i = toys.which-toy_list;
char *s;
- for (;;) {
- s = help_data;
- while (i--) s += strlen(s) + 1;
- // If it's an alias, restart search for real name
- if (*s != 255) break;
- i = toy_find(++s)-toy_list;
- }
+ if (CFG_TOYBOX_HELP) {
+ for (;;) {
+ s = help_data;
+ while (i--) s += strlen(s) + 1;
+ // If it's an alias, restart search for real name
+ if (*s != 255) break;
+ i = toy_find(++s)-toy_list;
+ }
- fprintf(out, "%s", s);
+ fprintf(out, "%s", s);
+ }
}
-#endif