aboutsummaryrefslogtreecommitdiff
path: root/gcc/cccp.c
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-01-26 06:00:49 +0000
committerRichard Stallman <rms@gnu.org>1993-01-26 06:00:49 +0000
commit625bbc6074531d90a8a44df63de73af18f9e17aa (patch)
treecb8325121a033431a2e8ac31d5a3c9b48e4f93bb /gcc/cccp.c
parent716f003f91219c1a6997a7fcc960c796ca73a82e (diff)
downloadgcc-625bbc6074531d90a8a44df63de73af18f9e17aa.zip
gcc-625bbc6074531d90a8a44df63de73af18f9e17aa.tar.gz
gcc-625bbc6074531d90a8a44df63de73af18f9e17aa.tar.bz2
(handle_directive): Init already_output after old_linenum label.
(finclude): Remove final backslash-newline *before* trigraph_pcp. (write_output): Free line_command at end. From-SVN: r3344
Diffstat (limited to 'gcc/cccp.c')
-rw-r--r--gcc/cccp.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/gcc/cccp.c b/gcc/cccp.c
index 51223a8..c28e3be 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.