summaryrefslogtreecommitdiff
path: root/gas/input-scrub.c
diff options
context:
space:
mode:
authorBernd Schmidt <bernd.schmidt@analog.com>2006-10-16 12:02:40 +0000
committerBernd Schmidt <bernd.schmidt@analog.com>2006-10-16 12:02:40 +0000
commit19324ce5e10ec62a2a660f3c1da01c45daa33b7e (patch)
tree0e42eeceb7c21219f45f9fbf2eec6f4b72a21fa9 /gas/input-scrub.c
parent89a19a0f84b6c7c5fc0700c68ee4df5ca2f20ab6 (diff)
downloadbinutils-redhat-19324ce5e10ec62a2a660f3c1da01c45daa33b7e.tar.gz
* input-scrub.c (input_scrub_next_buffer): Use TC_EOL_IN_INSN
in addition to testing for '\n'. (TC_EOL_IN_INSN): Provide a default definition if necessary.
Diffstat (limited to 'gas/input-scrub.c')
-rw-r--r--gas/input-scrub.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/gas/input-scrub.c b/gas/input-scrub.c
index 7407741b3f..9efea1100e 100644
--- a/gas/input-scrub.c
+++ b/gas/input-scrub.c
@@ -56,6 +56,10 @@
#define BEFORE_SIZE (1)
#define AFTER_SIZE (1)
+#ifndef TC_EOL_IN_INSN
+#define TC_EOL_IN_INSN(P) 0
+#endif
+
static char *buffer_start; /*->1st char of full buffer area. */
static char *partial_where; /*->after last full line in buffer. */
static int partial_size; /* >=0. Number of chars in partial line in buffer. */
@@ -341,8 +345,9 @@ input_scrub_next_buffer (char **bufp)
if (limit)
{
register char *p; /* Find last newline. */
-
- for (p = limit - 1; *p != '\n'; --p)
+ /* Terminate the buffer to avoid confusing TC_EOL_IN_INSN. */
+ *limit = '\0';
+ for (p = limit - 1; *p != '\n' || TC_EOL_IN_INSN (p); --p)
;
++p;
@@ -368,7 +373,9 @@ input_scrub_next_buffer (char **bufp)
return NULL;
}
- for (p = limit - 1; *p != '\n'; --p)
+ /* Terminate the buffer to avoid confusing TC_EOL_IN_INSN. */
+ *limit = '\0';
+ for (p = limit - 1; *p != '\n' || TC_EOL_IN_INSN (p); --p)
;
++p;
}