=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/m4/main.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- src/usr.bin/m4/main.c 1997/12/10 20:24:15 1.6 +++ src/usr.bin/m4/main.c 1997/12/20 15:39:14 1.7 @@ -1,5 +1,5 @@ -/* $OpenBSD: main.c,v 1.6 1997/12/10 20:24:15 deraadt Exp $ */ -/* $NetBSD: main.c,v 1.11 1996/01/13 23:25:26 pk Exp $ */ +/* $OpenBSD: main.c,v 1.7 1997/12/20 15:39:14 deraadt Exp $ */ +/* $NetBSD: main.c,v 1.12 1997/02/08 23:54:49 cgd Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -47,7 +47,7 @@ #if 0 static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: main.c,v 1.6 1997/12/10 20:24:15 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: main.c,v 1.7 1997/12/20 15:39:14 deraadt Exp $"; #endif #endif /* not lint */ @@ -280,7 +280,7 @@ */ void macro() { - char token[MAXTOK]; + char token[MAXTOK], chars[2]; register char *s; register int t, l; register ndptr p; @@ -331,24 +331,34 @@ continue; } /* - * non-alpha single-char token seen.. + * non-alpha token possibly seen.. * [the order of else if .. stmts is important.] */ else if (LOOK_AHEAD(t,lquote)) { /* strip quotes */ nlpar = 1; do { + l = gpbc(); - if (LOOK_AHEAD(l,rquote)) + if (LOOK_AHEAD(l,rquote)) { nlpar--; - else if (LOOK_AHEAD(l,lquote)) + s = rquote; + } else if (LOOK_AHEAD(l,lquote)) { nlpar++; - else if (l == EOF) + s = lquote; + } else if (l == EOF) oops("missing right quote", ""); + else { + chars[0] = l; + chars[1] = '\0'; + s = chars; + } if (nlpar > 0) { if (sp < 0) - putc(l, active); + while (*s) + putc(*s++, active); else - chrsave(l); + while (*s) + chrsave(*s++); } } while (nlpar != 0);