lib.c: (set_progname): Set program name even if `argv[0]' has no `/'.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 14 May 2021 20:46:24 +0000 (21:46 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 15 May 2021 13:59:00 +0000 (14:59 +0100)
At least it was `???' and not a null pointer, but it's still rather
poor.

lib.c

diff --git a/lib.c b/lib.c
index 251d932..eb2a586 100644 (file)
--- a/lib.c
+++ b/lib.c
@@ -51,7 +51,7 @@ void set_progname(const char *prog)
   const char *p;
 
   p = strrchr(prog, '/');
-  progname = p ? p + 1 : progname;
+  progname = p ? p + 1 : prog;
 }
 
 /* Report an error or warning in Unix style, given a captured argument