From: Alexander Kuleshov Date: Wed, 16 Mar 2016 14:27:29 GMT Subject: [PATCH] help.c: strip suffix only if the STRIP_EXTENSION defined Message-ID: <1458138449-26690-1-git-send-email-kuleshovmail@gmail.com> We stripping extension in the list_commands_in_dir() to get commands without '.exe' suffix. Let's do it only if STRIP_EXTENSION is defined to not spend time for unnecessary strip_suffix() call in this case. Signed-off-by: Alexander Kuleshov --- help.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/help.c b/help.c index 19328ea..c865991 100644 --- a/help.c +++ b/help.c @@ -153,8 +153,9 @@ static void list_commands_in_dir(struct cmdnames *cmds, continue; entlen = strlen(ent); - strip_suffix(ent, ".exe", &entlen); - +#ifdef STRIP_EXTENSION + strip_suffix(ent, STRIP_EXTENSION, &entlen); +#endif add_cmdname(cmds, ent, entlen); } closedir(dir); -- 2.8.0.rc2.216.g1477fb2.dirty