$NetBSD: patch-ac,v 1.5 2007/09/08 21:58:01 jlam Exp $ --- src/files.c.orig 2005-09-29 23:29:32.000000000 -0400 +++ src/files.c @@ -19,6 +19,7 @@ static char const RCSID[] = "$Id: files. #include #include +#include #include #ifdef TM_IN_SYS_TIME @@ -365,16 +366,27 @@ int DoInclude(ParsePtr p) { DynamicBuffer buf; int r, e; + glob_t g; + char **gp; DBufInit(&buf); + memset(&g, 0, sizeof(g)); + if ( (r=ParseToken(p, &buf)) ) return r; e = VerifyEoln(p); if (e) Eprint("%s", ErrMsg[e]); - if ( (r=IncludeFile(DBufValue(&buf))) ) { - DBufFree(&buf); - return r; - } + + glob(DBufValue(&buf), GLOB_NOCHECK|GLOB_BRACE|GLOB_TILDE, NULL, &g); DBufFree(&buf); + + for (gp = g.gl_pathv; gp && *gp; gp++) { + if ( (r=IncludeFile(*gp)) ) { + globfree(&g); + return r; + } + } + + globfree(&g); NumIfs = 0; IfFlags = 0; return OK;