aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/main.c b/main.c
index a311eb93..ccebdb4d 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.260 2015/12/15 17:38:45 schwarze Exp $ */
+/* $Id: main.c,v 1.261 2016/01/08 02:13:39 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2012, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -724,9 +724,11 @@ parse(struct curparse *curp, int fd, const char *file)
/* Begin by parsing the file itself. */
assert(file);
- assert(fd >= -1);
+ assert(fd > 0);
rctmp = mparse_readfd(curp->mp, fd, file);
+ if (fd != STDIN_FILENO)
+ close(fd);
if (rc < rctmp)
rc = rctmp;