summaryrefslogtreecommitdiff
path: root/usr.bin/m4/main.c
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2008-08-16 12:21:47 +0000
committerMarc Espie <espie@cvs.openbsd.org>2008-08-16 12:21:47 +0000
commit32a17bdecdd07e7941404eef0770c432860ea368 (patch)
treefd31854b3a2ed749f7632e27066c9bbc7b699d0a /usr.bin/m4/main.c
parent411f1cecb74fed58f93a6a2fa3d2f4d72864bb4c (diff)
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;