(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
This commit is contained in:
Richard Stallman 1993-01-26 06:00:49 +00:00
parent 716f003f91
commit 625bbc6074
1 changed files with 11 additions and 9 deletions

View File

@ -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.