diff options
author | Omar Polo <op@omarpolo.com> | 2024-08-05 18:10:36 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2024-08-05 18:10:36 +0000 |
commit | 0cf61ffcaf5321ee5888f5c1d247a1c383ff75fd (patch) | |
tree | d1430ddbab7911e79c083b2b86ad2a751311bc98 /have | |
parent | e27216e1c5bbaeb1074d4c65f38aa9b2072940ed (diff) |
configure/getprogname: fix handling and use __progname too
1. fix the handling of the fallbacks in getprogname
i.e. actually use the fallback
2. add a check for __progname too
See https://github.com/omar-polo/gmid/issues/35
Diffstat (limited to 'have')
-rw-r--r-- | have/Makefile | 1 | ||||
-rw-r--r-- | have/__progname.c | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/have/Makefile b/have/Makefile index bc9d7c5..3bb5f8f 100644 --- a/have/Makefile +++ b/have/Makefile @@ -5,6 +5,7 @@ DISTFILES = ASN1_time_parse.c \ SSL_CTX_load_verify_mem.c \ SSL_CTX_use_certificate_chain_mem.c \ X509_LOOKUP_mem.c \ + __progname.c \ arc4random.c \ arc4random_buf.c \ endian_h.c \ diff --git a/have/__progname.c b/have/__progname.c new file mode 100644 index 0000000..dbef94c --- /dev/null +++ b/have/__progname.c @@ -0,0 +1,11 @@ +/* public domain */ + +#include <stdio.h> + +extern const char *__progname; + +int +main(void) +{ + puts(__progname); +} |