From: Mark Wooding Date: Fri, 14 May 2021 20:46:24 +0000 (+0100) Subject: lib.c: (set_progname): Set program name even if `argv[0]' has no `/'. X-Git-Url: https://git.distorted.org.uk/~mdw/runlisp/commitdiff_plain/d6127242c41e7805b8c77131f4cbbb304e0d7d39 lib.c: (set_progname): Set program name even if `argv[0]' has no `/'. At least it was `???' and not a null pointer, but it's still rather poor. --- diff --git a/lib.c b/lib.c index 251d932..eb2a586 100644 --- 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