=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/m4/misc.c,v retrieving revision 1.34 retrieving revision 1.35 diff -c -r1.34 -r1.35 *** src/usr.bin/m4/misc.c 2005/09/07 13:22:24 1.34 --- src/usr.bin/m4/misc.c 2006/03/20 10:55:19 1.35 *************** *** 1,4 **** ! /* $OpenBSD: misc.c,v 1.34 2005/09/07 13:22:24 jmc Exp $ */ /* $NetBSD: misc.c,v 1.6 1995/09/28 05:37:41 tls Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: misc.c,v 1.35 2006/03/20 10:55:19 espie Exp $ */ /* $NetBSD: misc.c,v 1.6 1995/09/28 05:37:41 tls Exp $ */ /* *************** *** 122,131 **** int printed = 0; if (base > 36) ! errx(1, "base %d > 36: not supported", base); if (base < 2) ! errx(1, "bad base %d for conversion", base); num = (n < 0) ? -n : n; do { --- 122,131 ---- int printed = 0; if (base > 36) ! m4errx(1, "base %d > 36: not supported.", base); if (base < 2) ! m4errx(1, "bad base %d for conversion.", base); num = (n < 0) ? -n : n; do { *************** *** 228,234 **** int c; if (active == outfile[n]) ! errx(1, "undivert: diversion still active"); rewind(outfile[n]); while ((c = getc(outfile[n])) != EOF) putc(c, active); --- 228,234 ---- int c; if (active == outfile[n]) ! m4errx(1, "undivert: diversion still active."); rewind(outfile[n]); while ((c = getc(outfile[n])) != EOF) putc(c, active); *************** *** 256,261 **** --- 256,278 ---- if (outfile[n] != NULL) { (void) fclose(outfile[n]); } + } + + extern char *__progname; + + void + m4errx(int eval, const char *fmt, ...) + { + va_list ap; + + va_start(ap, fmt); + fprintf(stderr, "%s: ", __progname); + fprintf(stderr, "%s at line %lu: ", CURRENT_NAME, CURRENT_LINE); + if (fmt != NULL) + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\n"); + exit(eval); + va_end(ap); } /*