summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/main.c b/main.c
index 65659a44..aed5ed9c 100644
--- a/main.c
+++ b/main.c
@@ -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;