From d2c324e4d56a65de9a925ea293ef473ee7050833 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Mon, 28 May 2007 19:32:58 +0000 Subject: [PATCH] * app.c (do_scrub_chars): Cope with \ at end of buffer.x --- gas/ChangeLog | 4 ++++ gas/app.c | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 95dfaa44de..8d9483a120 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,7 @@ +2007-05-28 Nathan Sidwell + + * app.c (do_scrub_chars): Cope with \ at end of buffer. + 2007-05-26 Alan Modra * config/tc-ppc.c (ppc_insert_operand): Truncate sign bits in diff --git a/gas/app.c b/gas/app.c index aa180044e7..d7eb50926d 100644 --- a/gas/app.c +++ b/gas/app.c @@ -1360,7 +1360,15 @@ do_scrub_chars (int (*get) (char *, int), char *tostart, int tolen) the space. We don't have enough information to make the right choice, so here we are making the choice which is more likely to be correct. */ - PUT (' '); + if (to + 1 >= toend) + { + /* If we're near the end of the buffer, save the + character for the next time round. Otherwise + we'll lose our state. */ + UNGET (ch); + goto tofull; + } + *to++ = ' '; } state = 3; -- 2.11.0