summaryrefslogtreecommitdiff
path: root/gas/app.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2007-05-28 19:32:58 +0000
committerNathan Sidwell <nathan@codesourcery.com>2007-05-28 19:32:58 +0000
commitd2c324e4d56a65de9a925ea293ef473ee7050833 (patch)
tree15fbf7fa4723937b809de8e53535b71f89afcc35 /gas/app.c
parenta18fa75504350d4c5ce8a8d2eca284fd422bd7b7 (diff)
downloadbinutils-redhat-d2c324e4d56a65de9a925ea293ef473ee7050833.tar.gz
* app.c (do_scrub_chars): Cope with \ at end of buffer.x
Diffstat (limited to 'gas/app.c')
-rw-r--r--gas/app.c10
1 files changed, 9 insertions, 1 deletions
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;