aboutsummaryrefslogtreecommitdiff
path: root/gas/app.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2007-07-20 08:20:27 +0000
committerNick Clifton <nickc@redhat.com>2007-07-20 08:20:27 +0000
commitfc5910c0bb75c4d2f825cbeb2ce77d1baa136b60 (patch)
tree9d6137c41b8ea1b706c1fa3c61dc156f970fe3c1 /gas/app.c
parent3185aeeca7505e1176e023327af4a73ede3d60d2 (diff)
downloadgdb-fc5910c0bb75c4d2f825cbeb2ce77d1baa136b60.zip
gdb-fc5910c0bb75c4d2f825cbeb2ce77d1baa136b60.tar.gz
gdb-fc5910c0bb75c4d2f825cbeb2ce77d1baa136b60.tar.bz2
* app.c (do_scrub_chars): Provide a one character buffer to hold a
pushed back newline at the end of an unterminated quoted string.
Diffstat (limited to 'gas/app.c')
-rw-r--r--gas/app.c6
1 files changed, 6 insertions, 0 deletions
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);
}