summaryrefslogtreecommitdiff
path: root/src/help.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2020-05-04 21:45:11 +0300
committerTimo Teräs <timo.teras@iki.fi>2020-05-06 13:05:25 +0300
commit1d7123d83796182f851ccccaf056063955343718 (patch)
treeca675fd3363af3584694d0db5a3b65e618ae894b /src/help.c
parent791f93fcbe7a543e0bb844887ba395be8ed8ea44 (diff)
downloadapk-tools-1d7123d83796182f851ccccaf056063955343718.tar.gz
apk-tools-1d7123d83796182f851ccccaf056063955343718.tar.bz2
apk-tools-1d7123d83796182f851ccccaf056063955343718.tar.xz
apk-tools-1d7123d83796182f851ccccaf056063955343718.zip
rewrite option descriptors to be single string
This reduces the number of relocations on PIE binaries, and also reduces the executable size. Parsing of the options is slightly sped up as only the exact matching option group parser is called.
Diffstat (limited to 'src/help.c')
-rw-r--r--src/help.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/help.c b/src/help.c
index a27992a..ece6845 100644
--- a/src/help.c
+++ b/src/help.c
@@ -17,7 +17,7 @@ static int is_group(struct apk_applet *applet, const char *topic)
if (!applet) return strcasecmp(topic, "apk") == 0;
if (strcasecmp(topic, applet->name) == 0) return 1;
for (int i = 0; applet->optgroups[i] && i < ARRAY_SIZE(applet->optgroups); i++)
- if (strcasecmp(applet->optgroups[i]->name, topic) == 0) return 1;
+ if (strcasecmp(applet->optgroups[i]->desc, topic) == 0) return 1;
return 0;
}