* popthelp.c (showHelpIntro): The basename of argv[0] starts after

the last slash in argv[0], not after the first.
This commit is contained in:
Roland Illig 2004-11-11 17:37:20 +00:00
parent 8d4cf30242
commit d3204db4e0
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2004-11-11 Roland Illig <roland.illig@gmx.de>
* popthelp.c (showHelpIntro): The basename of argv[0] starts after
the last slash in argv[0], not after the first.
From Egmont Koblinger <egmont * uhulinux hu>
2004-11-10 Roland Illig <roland.illig@gmx.de>
* Makefile.am: Excluded pipethough.{c,h} from the distribution

View File

@ -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;
}