diff --git a/src/lib-popt/popthelp.c b/src/lib-popt/popthelp.c index 243f868e..15ed2d95 100644 --- a/src/lib-popt/popthelp.c +++ b/src/lib-popt/popthelp.c @@ -175,7 +175,7 @@ static int showHelpIntro(poptContext con, FILE * f) { fprintf(f, POPT_("Usage:")); if (!(con->flags & POPT_CONTEXT_KEEP_FIRST)) { fn = con->optionStack->argv[0]; - if (strchr(fn, '/')) fn = strchr(fn, '/') + 1; + if (strrchr(fn, '/')) fn = strrchr(fn, '/') + 1; fprintf(f, " %s", fn); len += strlen(fn) + 1; }