diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2016-06-20 16:16:15 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2016-06-20 16:20:20 +0300 |
commit | 91610984e90d0062cb4ea50b37428559d5e4ede5 (patch) | |
tree | 99deb3719161a870e98eea008f4aaf8619855e58 | |
parent | 6ab660a7f9a9857a56cff44765144016356bd9f1 (diff) | |
download | grecs-91610984e90d0062cb4ea50b37428559d5e4ede5.tar.gz grecs-91610984e90d0062cb4ea50b37428559d5e4ede5.tar.bz2 |
Avoid closing stdin.
The default grecs parser closes stdin before returning. This might
cause grief for programs assuming that open(2) never returns 0.
* src/grecs-lex.l (yywrap): Avoid closing stdin. The yyin variable
has meaning only if grecs_preprocessor is set. Otherwise, it will
be assigned the pointer to stdin by lex-generated code.
-rw-r--r-- | src/grecs-lex.l | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/grecs-lex.l b/src/grecs-lex.l index 98bf384..bf97730 100644 --- a/src/grecs-lex.l +++ b/src/grecs-lex.l @@ -192,7 +192,7 @@ pid_t grecs_preproc_pid; int yywrap() { - if (yyin) { + if (grecs_preprocessor) { grecs_preproc_extrn_shutdown(grecs_preproc_pid); fclose(yyin); } else |