summaryrefslogtreecommitdiffstats
path: root/usr.bin/m4/main.c
diff options
context:
space:
mode:
authorespie <espie@openbsd.org>2008-08-16 12:21:46 +0000
committerespie <espie@openbsd.org>2008-08-16 12:21:46 +0000
commit456f9fcb4d6c04a41332c34b82ff40908fd74afa (patch)
tree896aaaf10939105d445c3e20f5d77c539868058e /usr.bin/m4/main.c
parentbe more liberal in include handling, namely we only error out if it's (diff)
downloadwireguard-openbsd-456f9fcb4d6c04a41332c34b82ff40908fd74afa.tar.xz
wireguard-openbsd-456f9fcb4d6c04a41332c34b82ff40908fd74afa.zip
argument parsing should only skip spaces outside of parenthesis.
Inside matching parenthesis, keep spaces as is (use chrsave instead of pbstr, since there's no way it can be a further macro expansion). Fixes a long-standing issue with autoconf ( --option -> --option), matches other m4 than gnum4 okay millert@, fries@
Diffstat (limited to 'usr.bin/m4/main.c')
-rw-r--r--usr.bin/m4/main.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/m4/main.c b/usr.bin/m4/main.c
index b85ac986cee..377af13a2f3 100644
--- a/usr.bin/m4/main.c
+++ b/usr.bin/m4/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.75 2008/08/16 12:19:49 espie Exp $ */
+/* $OpenBSD: main.c,v 1.76 2008/08/16 12:21:46 espie Exp $ */
/* $NetBSD: main.c,v 1.12 1997/02/08 23:54:49 cgd Exp $ */
/*-
@@ -428,8 +428,9 @@ macro(void)
case LPAREN:
if (PARLEV > 0)
chrsave(t);
- while (isspace(l = gpbc()))
- ; /* skip blank, tab, nl.. */
+ while (isspace(l = gpbc())) /* skip blank, tab, nl.. */
+ if (PARLEV > 0)
+ chrsave(l);
pushback(l);
record(paren, PARLEV++);
break;