From d3204db4e08efb4c79794698190dc2cc12affaa7 Mon Sep 17 00:00:00 2001 From: Roland Illig Date: Thu, 11 Nov 2004 17:37:20 +0000 Subject: [PATCH] * popthelp.c (showHelpIntro): The basename of argv[0] starts after the last slash in argv[0], not after the first. --- src/ChangeLog | 7 +++++++ src/popthelp.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index e50b9d8b9..f0d875781 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2004-11-11 Roland Illig + + * popthelp.c (showHelpIntro): The basename of argv[0] starts after + the last slash in argv[0], not after the first. + + From Egmont Koblinger + 2004-11-10 Roland Illig * Makefile.am: Excluded pipethough.{c,h} from the distribution diff --git a/src/popthelp.c b/src/popthelp.c index 33ad0207c..d99ac4464 100644 --- a/src/popthelp.c +++ b/src/popthelp.c @@ -179,7 +179,7 @@ static int showHelpIntro(poptContext con, FILE * f) { fprintf(f, _("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; }