Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/m4 Fix __progname mess.
details: https://anonhg.NetBSD.org/src/rev/4ea4e33a84f9
branches: trunk
changeset: 748823:4ea4e33a84f9
user: joerg <joerg%NetBSD.org@localhost>
date: Fri Nov 06 15:13:27 2009 +0000
description:
Fix __progname mess.
diffstat:
usr.bin/m4/main.c | 6 ++++--
usr.bin/m4/misc.c | 8 +++-----
2 files changed, 7 insertions(+), 7 deletions(-)
diffs (61 lines):
diff -r 7febce4f4767 -r 4ea4e33a84f9 usr.bin/m4/main.c
--- a/usr.bin/m4/main.c Fri Nov 06 15:00:31 2009 +0000
+++ b/usr.bin/m4/main.c Fri Nov 06 15:13:27 2009 +0000
@@ -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 <sys/cdefs.h>
-__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 <assert.h>
#include <signal.h>
#include <err.h>
@@ -176,6 +176,8 @@
int n;
char *p;
+ setprogname(argv[0]);
+
if (signal(SIGINT, SIG_IGN) != SIG_IGN)
signal(SIGINT, onintr);
diff -r 7febce4f4767 -r 4ea4e33a84f9 usr.bin/m4/misc.c
--- a/usr.bin/m4/misc.c Fri Nov 06 15:00:31 2009 +0000
+++ b/usr.bin/m4/misc.c Fri Nov 06 15:13:27 2009 +0000
@@ -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 <sys/cdefs.h>
-__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 <sys/types.h>
#include <errno.h>
#include <unistd.h>
@@ -262,12 +262,10 @@
}
}
-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;
Home |
Main Index |
Thread Index |
Old Index