From: Nick Clifton Date: Fri, 20 Jul 2007 08:20:27 +0000 (+0000) Subject: * app.c (do_scrub_chars): Provide a one character buffer to hold a X-Git-Tag: binutils-2_18-branchpoint~156 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fc5910c0bb75c4d2f825cbeb2ce77d1baa136b60;p=platform%2Fupstream%2Fbinutils.git * app.c (do_scrub_chars): Provide a one character buffer to hold a pushed back newline at the end of an unterminated quoted string. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 602c58c..f381533 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2007-07-20 Nick Clifton + + * app.c (do_scrub_chars): Provide a one character buffer to hold a + pushed back newline at the end of an unterminated quoted string. + 2007-07-14 Nick Clifton * config/tc-arm.c (create_register_alias): Return a boolean rather diff --git a/gas/app.c b/gas/app.c index 637662f..d8d0cc5 100644 --- a/gas/app.c +++ b/gas/app.c @@ -558,8 +558,14 @@ do_scrub_chars (int (*get) (char *, int), char *tostart, int tolen) ch = GET (); if (ch == EOF) { + /* This buffer is here specifically so + that the UNGET below will work. */ + static char one_char_buf[1]; + as_warn (_("end of file in string; '%c' inserted"), quotechar); state = old_state; + from = fromend = one_char_buf + 1; + fromlen = 1; UNGET ('\n'); PUT (quotechar); }