From 98712b66ed4dfd5d1e1f5ffcceefd76c524ac6a9 Mon Sep 17 00:00:00 2001 From: joerg Date: Fri, 6 Nov 2009 15:13:27 +0000 Subject: [PATCH] Fix __progname mess. --- usr.bin/m4/main.c | 6 ++++-- usr.bin/m4/misc.c | 8 +++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/usr.bin/m4/main.c b/usr.bin/m4/main.c index 95ca6618c0df..734d6d7b777e 100644 --- a/usr.bin/m4/main.c +++ b/usr.bin/m4/main.c @@ -1,5 +1,5 @@ /* $OpenBSD: main.c,v 1.77 2009/10/14 17:19:47 sthen Exp $ */ -/* $NetBSD: main.c,v 1.38 2009/10/26 21:11:28 christos Exp $ */ +/* $NetBSD: main.c,v 1.39 2009/11/06 15:13:27 joerg Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -42,7 +42,7 @@ #include "nbtool_config.h" #endif #include -__RCSID("$NetBSD: main.c,v 1.38 2009/10/26 21:11:28 christos Exp $"); +__RCSID("$NetBSD: main.c,v 1.39 2009/11/06 15:13:27 joerg Exp $"); #include #include #include @@ -176,6 +176,8 @@ main(int argc, char *argv[]) int n; char *p; + setprogname(argv[0]); + if (signal(SIGINT, SIG_IGN) != SIG_IGN) signal(SIGINT, onintr); diff --git a/usr.bin/m4/misc.c b/usr.bin/m4/misc.c index f3d727b41920..d06b27578963 100644 --- a/usr.bin/m4/misc.c +++ b/usr.bin/m4/misc.c @@ -1,5 +1,5 @@ /* $OpenBSD: misc.c,v 1.41 2009/10/14 17:19:47 sthen Exp $ */ -/* $NetBSD: misc.c,v 1.19 2009/10/26 21:11:28 christos Exp $ */ +/* $NetBSD: misc.c,v 1.20 2009/11/06 15:13:27 joerg Exp $ */ /* * Copyright (c) 1989, 1993 @@ -36,7 +36,7 @@ #include "nbtool_config.h" #endif #include -__RCSID("$NetBSD: misc.c,v 1.19 2009/10/26 21:11:28 christos Exp $"); +__RCSID("$NetBSD: misc.c,v 1.20 2009/11/06 15:13:27 joerg Exp $"); #include #include #include @@ -262,12 +262,10 @@ killdiv() } } -extern char *__progname; - void m4errx(int exval, const char *fmt, ...) { - fprintf(stderr, "%s: ", __progname); + fprintf(stderr, "%s: ", getprogname()); fprintf(stderr, "%s at line %lu: ", CURRENT_NAME, CURRENT_LINE); if (fmt != NULL) { va_list ap;