diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-10-01 14:46:48 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-10-01 14:46:48 +0900 |
commit | d0f7d1600a68ca84f5d5e79e6db806af5c48c2d1 (patch) | |
tree | 31f84f7545a6919c5fdeb6092024200e9a1e801c /output.c | |
parent | 3357ebc48c62accd6db71e8abbbb9fe53f3e877c (diff) | |
download | byacc-d0f7d1600a68ca84f5d5e79e6db806af5c48c2d1.tar.gz byacc-d0f7d1600a68ca84f5d5e79e6db806af5c48c2d1.tar.bz2 byacc-d0f7d1600a68ca84f5d5e79e6db806af5c48c2d1.zip |
Imported Upstream version 20130304upstream/20130304
Diffstat (limited to 'output.c')
-rw-r--r-- | output.c | 20 |
1 files changed, 13 insertions, 7 deletions
@@ -1,4 +1,4 @@ -/* $Id: output.c,v 1.44 2012/05/26 01:13:02 tom Exp $ */ +/* $Id: output.c,v 1.45 2013/03/05 00:29:17 tom Exp $ */ #include "defs.h" @@ -861,9 +861,12 @@ output_defines(FILE * fp) { if (unionized) { - rewind(union_file); - while ((c = getc(union_file)) != EOF) - putc(c, fp); + if (union_file != 0) + { + rewind(union_file); + while ((c = getc(union_file)) != EOF) + putc(c, fp); + } fprintf(fp, "extern YYSTYPE %slval;\n", symbol_prefix); } } @@ -1446,9 +1449,12 @@ output(void) if (iflag) { - ++outline; - fprintf(code_file, "#include \"%s\"\n", defines_file_name); - if (!dflag) + if (dflag) + { + ++outline; + fprintf(code_file, "#include \"%s\"\n", defines_file_name); + } + else output_defines(externs_file); } else |