From: Alexey Makhalov Date: Tue, 19 Nov 2013 08:19:21 +0000 (+0000) Subject: PR gas/16109 X-Git-Tag: hjl/linux/release/2.24.51.0.2~3^2~6^2~100 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cf3f45fad7811e89d6b586a1a429a314e3db9f53;p=thirdparty%2Fbinutils-gdb.git PR gas/16109 * app.c (do_scrub_chars): Only insert a newline character if end-of-file has been reached. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index fddf422d6e3..3813336265e 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2013-11-19 Alexey Makhalov + + PR gas/16109 + * app.c (do_scrub_chars): Only insert a newline character if + end-of-file has been reached. + 2013-11-18 H.J. Lu * config/tc-i386.c (lex_got): Add a dummy "int bnd_prefix" diff --git a/gas/app.c b/gas/app.c index ec3a35ee865..1a7ce95289b 100644 --- a/gas/app.c +++ b/gas/app.c @@ -1217,9 +1217,16 @@ do_scrub_chars (size_t (*get) (char *, size_t), char *tostart, size_t tolen) while (ch != EOF && !IS_NEWLINE (ch)) ch = GET (); if (ch == EOF) - as_warn (_("end of file in comment; newline inserted")); + { + as_warn (_("end of file in comment; newline inserted")); + PUT ('\n'); + } + else /* IS_NEWLINE (ch) */ + { + /* To process non-zero add_newlines. */ + UNGET (ch); + } state = 0; - PUT ('\n'); break; } /* Looks like `# 123 "filename"' from cpp. */