/usr/bin/mc --help prints stupid path
Egmont Koblinger
egmont at uhulinux.hu
Thu Nov 11 17:10:14 UTC 2004
Hi,
"/usr/bin/mc --help" prints this:
Usage: usr/bin/mc [flags] [this_dir] [other_panel_dir]
^^^
Only the leading slash is stipped, which doesn't make too much sense.
Trivial patch is attached, fixes both 4.6.0 and 2004-11-04-05 snapshot.
bye,
--
Egmont
-------------- next part --------------
diff -Naur mc-4.6.0.orig/src/popthelp.c mc-4.6.0/src/popthelp.c
--- mc-4.6.0.orig/src/popthelp.c 2002-10-24 12:02:40.000000000 +0200
+++ mc-4.6.0/src/popthelp.c 2004-11-11 00:20:54.000000000 +0100
@@ -179,7 +179,7 @@
fprintf(f, _("Usage:"));
if (!(con->flags & POPT_CONTEXT_KEEP_FIRST)) {
fn = con->optionStack->argv[0];
- if (strchr(fn, '/')) fn = strchr(fn, '/') + 1;
+ if (strchr(fn, '/')) fn = strrchr(fn, '/') + 1;
fprintf(f, " %s", fn);
len += strlen(fn) + 1;
}
More information about the mc-devel
mailing list