diff options
author | rms <rms@138bc75d-0d04-0410-961f-82ee72b054a4> | 1993-01-26 06:00:49 +0000 |
---|---|---|
committer | rms <rms@138bc75d-0d04-0410-961f-82ee72b054a4> | 1993-01-26 06:00:49 +0000 |
commit | fd0f122d4f3bac840c5aa8f67cf5b8ca57a799c2 (patch) | |
tree | cb8325121a033431a2e8ac31d5a3c9b48e4f93bb /gcc/cccp.c | |
parent | 1c8c3750cba039138be1d719933f00c20865957b (diff) | |
download | gcc-fd0f122d4f3bac840c5aa8f67cf5b8ca57a799c2.tar.gz |
(handle_directive): Init already_output after old_linenum label.
(finclude): Remove final backslash-newline *before* trigraph_pcp.
(write_output): Free line_command at end.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@3344 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cccp.c')
-rw-r--r-- | gcc/cccp.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/gcc/cccp.c b/gcc/cccp.c index 51223a81377..c28e3be624e 100644 --- a/gcc/cccp.c +++ b/gcc/cccp.c @@ -3232,7 +3232,7 @@ handle_directive (ip, op) register U_CHAR *limit; int unterminated; int junk; - int *already_output = 0; + int *already_output; /* Nonzero means do not delete comments within the directive. #define needs this when -traditional. */ @@ -3242,6 +3242,7 @@ handle_directive (ip, op) limit = ip->buf + ip->length; unterminated = 0; + already_output = 0; keep_comments = traditional && kt->traditional_comments; /* #import is defined only in Objective C, or when on the NeXT. */ if (kt->type == T_IMPORT && !(objc || lookup ("__NeXT__", -1, -1))) @@ -4183,6 +4184,14 @@ finclude (f, fname, op, system_header_p, dirptr) fp->length = st_size; } + if ((fp->length > 0 && fp->buf[fp->length - 1] != '\n') + /* Backslash-newline at end is not good enough. */ + || (fp->length > 1 && fp->buf[fp->length - 2] == '\\')) { + fp->buf[fp->length++] = '\n'; + missing_newline = 1; + } + fp->buf[fp->length] = '\0'; + /* Close descriptor now, so nesting does not use lots of descriptors. */ close (f); @@ -4195,14 +4204,6 @@ finclude (f, fname, op, system_header_p, dirptr) if (!no_trigraphs) trigraph_pcp (fp); - if ((fp->length > 0 && fp->buf[fp->length - 1] != '\n') - /* Backslash-newline at end is not good enough. */ - || (fp->length > 1 && fp->buf[fp->length - 2] == '\\')) { - fp->buf[fp->length++] = '\n'; - missing_newline = 1; - } - fp->buf[fp->length] = '\0'; - output_line_command (fp, op, 0, enter_file); rescan (op, 0); @@ -4646,6 +4647,7 @@ write_output () cur_buf_loc += len; } } + free (line_command); } /* Pass a directive through to the output file. |