From: espie Date: Sat, 16 Aug 2008 12:19:49 +0000 (+0000) Subject: be more liberal in include handling, namely we only error out if it's X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=bd3d270542b88bf317b6d1201645d38c8cd4727c;p=openbsd be more liberal in include handling, namely we only error out if it's the end of the last included file AND we still have a macro to expand. autoconf uses this in wine, and it turns out other m4 also do things that way (not only gnu m4). okay fries@, millert@ --- diff --git a/usr.bin/m4/main.c b/usr.bin/m4/main.c index 064db65dc2d..b85ac986cee 100644 --- a/usr.bin/m4/main.c +++ b/usr.bin/m4/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.74 2006/03/24 08:03:44 espie Exp $ */ +/* $OpenBSD: main.c,v 1.75 2008/08/16 12:19:49 espie Exp $ */ /* $NetBSD: main.c,v 1.12 1997/02/08 23:54:49 cgd Exp $ */ /*- @@ -408,7 +408,7 @@ macro(void) } } } else if (t == EOF) { - if (sp > -1) { + if (sp > -1 && ilevel <= 0) { warnx( "unexpected end of input, unclosed parenthesis:"); dump_stack(paren, PARLEV); exit(1);