aboutsummaryrefslogtreecommitdiff
path: root/vis-modes.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-02-23 16:52:35 +0100
committerMarc André Tanner <mat@brain-dump.org>2017-02-24 09:55:32 +0100
commitf2090b4b13c13711e6e1b9d3a7cde2cf5f121efe (patch)
tree0deb128262b23ef103e3160ddc3f8064b2307956 /vis-modes.c
parent615a2c403833f0db591d56c5406dae23ca711777 (diff)
downloadvis-f2090b4b13c13711e6e1b9d3a7cde2cf5f121efe.tar.gz
vis-f2090b4b13c13711e6e1b9d3a7cde2cf5f121efe.tar.xz
vis: make help texts optional to produce a smaller binary
$ ./configure --disable-help shrinks the binary by about 20K on a x86_64 system.
Diffstat (limited to 'vis-modes.c')
-rw-r--r--vis-modes.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/vis-modes.c b/vis-modes.c
index 47d02c1..00b99a7 100644
--- a/vis-modes.c
+++ b/vis-modes.c
@@ -8,7 +8,7 @@ static void keyaction_free(KeyAction *action) {
if (!action)
return;
free((char*)action->name);
- free((char*)action->help);
+ free(VIS_HELP_USE((char*)action->help));
free(action);
}
@@ -18,8 +18,10 @@ KeyAction *vis_action_new(Vis *vis, const char *name, const char *help, KeyActio
return NULL;
if (name && !(action->name = strdup(name)))
goto err;
+#if CONFIG_HELP
if (help && !(action->help = strdup(help)))
goto err;
+#endif
action->func = func;
action->arg = arg;
if (!array_add_ptr(&vis->actions_user, action))