=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/m4/main.c,v retrieving revision 1.10 retrieving revision 1.11 diff -c -r1.10 -r1.11 *** src/usr.bin/m4/main.c 1998/06/02 20:46:40 1.10 --- src/usr.bin/m4/main.c 1999/09/06 13:10:48 1.11 *************** *** 1,4 **** ! /* $OpenBSD: main.c,v 1.10 1998/06/02 20:46:40 deraadt Exp $ */ /* $NetBSD: main.c,v 1.12 1997/02/08 23:54:49 cgd Exp $ */ /*- --- 1,4 ---- ! /* $OpenBSD: main.c,v 1.11 1999/09/06 13:10:48 espie Exp $ */ /* $NetBSD: main.c,v 1.12 1997/02/08 23:54:49 cgd Exp $ */ /*- *************** *** 47,53 **** #if 0 static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93"; #else ! static char rcsid[] = "$OpenBSD: main.c,v 1.10 1998/06/02 20:46:40 deraadt Exp $"; #endif #endif /* not lint */ --- 47,53 ---- #if 0 static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93"; #else ! static char rcsid[] = "$OpenBSD: main.c,v 1.11 1999/09/06 13:10:48 espie Exp $"; #endif #endif /* not lint */ *************** *** 64,69 **** --- 64,70 ---- #include #include #include + #include #include "mdef.h" #include "stdd.h" #include "extern.h" *************** *** 89,95 **** int oindex = 0; /* diversion index.. */ char *null = ""; /* as it says.. just a null.. */ char *m4wraps = ""; /* m4wrap string default.. */ - char *progname; /* name of this program */ char lquote[MAXCCHARS+1] = {LQUOTE}; /* left quote character (`) */ char rquote[MAXCCHARS+1] = {RQUOTE}; /* right quote character (') */ char scommt[MAXCCHARS+1] = {SCOMMT}; /* start character for comment */ --- 90,95 ---- *************** *** 160,167 **** char *p; register FILE *ifp; - progname = basename(argv[0]); - if (signal(SIGINT, SIG_IGN) != SIG_IGN) signal(SIGINT, onintr); --- 160,165 ---- *************** *** 205,211 **** if (p[0] == '-' && p[1] == '\0') ifp = stdin; else if ((ifp = fopen(p, "r")) == NULL) ! oops("%s: %s", p, strerror(errno)); sp = -1; fp = 0; infile[0] = ifp; --- 203,209 ---- if (p[0] == '-' && p[1] == '\0') ifp = stdin; else if ((ifp = fopen(p, "r")) == NULL) ! err(1, "%s", p); sp = -1; fp = 0; infile[0] = ifp; *************** *** 258,264 **** int i; if (t != token[0]) ! oops("internal error", ""); for (i = 1; *++token; i++) { t = gpbc(); --- 256,262 ---- int i; if (t != token[0]) ! errx(1, "internal error"); for (i = 1; *++token; i++) { t = gpbc(); *************** *** 323,329 **** } else if (t == EOF) { if (sp > -1) ! oops("unexpected end of input", ""); if (ilevel <= 0) break; /* all done thanks.. */ --ilevel; --- 321,327 ---- } else if (t == EOF) { if (sp > -1) ! errx(1, "unexpected end of input"); if (ilevel <= 0) break; /* all done thanks.. */ --ilevel; *************** *** 347,353 **** nlpar++; s = lquote; } else if (l == EOF) ! oops("missing right quote", ""); else { chars[0] = l; chars[1] = '\0'; --- 345,351 ---- nlpar++; s = lquote; } else if (l == EOF) ! errx(1, "missing right quote"); else { chars[0] = l; chars[1] = '\0'; *************** *** 406,412 **** chrsave(EOS); if (sp == STACKMAX) ! oops("internal stack overflow", ""); if (CALTYP == MACRTYPE) expand((char **) mstack+fp+1, sp-fp); --- 404,410 ---- chrsave(EOS); if (sp == STACKMAX) ! errx(1, "internal stack overflow"); if (CALTYP == MACRTYPE) expand((char **) mstack+fp+1, sp-fp); *************** *** 456,462 **** h = (h << 5) + h + (*tp++ = c); putback(c); if (tp == etp) ! oops("token too long", ""); *tp = EOS; --- 454,460 ---- h = (h << 5) + h + (*tp++ = c); putback(c); if (tp == etp) ! errx(1, "token too long"); *tp = EOS;