summaryrefslogtreecommitdiff
path: root/usr.bin/make/parse.c
diff options
context:
space:
mode:
authordsl <dsl@NetBSD.org>2006-12-07 21:34:16 +0000
committerdsl <dsl@NetBSD.org>2006-12-07 21:34:16 +0000
commit82e7102f1ff154bb1e119ef513bfaf19cdcf8d17 (patch)
treef25daa75af16c17d7611843b46a8940f44f37350 /usr.bin/make/parse.c
parenta294d83a633e3c708e667257e6b4508fb17e2b37 (diff)
Revert part of a recent commit.
ParseEOF() shouldn't close the original file.
Diffstat (limited to 'usr.bin/make/parse.c')
-rw-r--r--usr.bin/make/parse.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c
index 24cb2e7f7c6..dc896eeca4a 100644
--- a/usr.bin/make/parse.c
+++ b/usr.bin/make/parse.c
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.123 2006/12/07 21:07:01 dsl Exp $ */
+/* $NetBSD: parse.c,v 1.124 2006/12/07 21:34:16 dsl Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.123 2006/12/07 21:07:01 dsl Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.124 2006/12/07 21:34:16 dsl Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: parse.c,v 1.123 2006/12/07 21:07:01 dsl Exp $");
+__RCSID("$NetBSD: parse.c,v 1.124 2006/12/07 21:34:16 dsl Exp $");
#endif
#endif /* not lint */
#endif
@@ -2046,19 +2046,20 @@ ParseEOF(void)
{
IFile *ifile; /* the state on the top of the includes stack */
- /* XXX dispose of curFile info */
- /* Leak curFile.fname because all the gnodes have pointers to it */
- if (curFile.F)
- (void)fclose(curFile.F);
- free(curFile.P_str);
-
if (Lst_IsEmpty(includes)) {
+ /* Don't close original file */
Var_Delete(".PARSEDIR", VAR_GLOBAL);
Var_Delete(".PARSEFILE", VAR_GLOBAL);
memset(&curFile, 0, sizeof curFile);
return (DONE);
}
+ /* XXX dispose of curFile info */
+ /* Leak curFile.fname because all the gnodes have pointers to it */
+ if (curFile.F)
+ (void)fclose(curFile.F);
+ free(curFile.P_str);
+
ifile = (IFile *)Lst_DeQueue(includes);
memcpy(&curFile, ifile, sizeof(IFile));