From 5907a150d5e9ac5dbdae3755e2ea48c482dcff3c Mon Sep 17 00:00:00 2001 From: imp Date: Thu, 17 May 2007 04:53:52 +0000 Subject: Fix some problems that affect multiple file inclusion. Bruce found this bug and submitted these patches to dunstan@. He sent them to me to test, and I discovered they were needed for the atmel kernel config files. Since we were playing with them in the terminal room after the developer's summit today, I thought I'd go ahead and commit them to allow those folks that now have atmel hardware (thanks Andre) a chance to try it out w/o my help. Since dunstan@ is asleep right now, risk stepping on his toes a little by going ahead and committing this change. Submitted by: dunstan@, bde@ Tested by: bde@ --- usr.sbin/config/main.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'usr.sbin/config/main.c') diff --git a/usr.sbin/config/main.c b/usr.sbin/config/main.c index c0c6b2a..a3b300a 100644 --- a/usr.sbin/config/main.c +++ b/usr.sbin/config/main.c @@ -150,14 +150,14 @@ main(int argc, char **argv) usage(); PREFIX = *argv; - /* - * We mark lack of DEFAULTS here. Once we hit EOF in PREFIX, yywrap() - * will try to bring DEFAULTS to the playground, if this exists. - */ - found_defaults = 0; - if (freopen(PREFIX, "r", stdin) == NULL) - err(2, "%s", PREFIX); - yyfile = PREFIX; + if (freopen("DEFAULTS", "r", stdin) != NULL) { + found_defaults = 1; + yyfile = "DEFAULTS"; + } else { + if (freopen(PREFIX, "r", stdin) == NULL) + err(2, "%s", PREFIX); + yyfile = PREFIX; + } if (*destdir != '\0') { len = strlen(destdir); while (len > 1 && destdir[len - 1] == '/') @@ -184,7 +184,6 @@ main(int argc, char **argv) STAILQ_INIT(&fntab); STAILQ_INIT(&ftab); STAILQ_INIT(&hints); - STAILQ_INIT(&rmdtab); if (yyparse()) exit(3); -- cgit v1.1