diff options
author | H.J. Lu <hjl@lucon.org> | 2009-03-24 01:04:25 +0000 |
---|---|---|
committer | H.J. Lu <hjl@lucon.org> | 2009-03-24 01:04:25 +0000 |
commit | 95964fc43bf680dd87e5153aecbc3a5c6f15ca7c (patch) | |
tree | 455902134083a27464ef2626ffdac4eb8568a92d /gas/listing.c | |
parent | d7fba78566772bed2c1eba0c538bc0f405ea6245 (diff) | |
download | binutils-redhat-95964fc43bf680dd87e5153aecbc3a5c6f15ca7c.tar.gz |
2009-03-23 H.J. Lu <hongjiu.lu@intel.com>
PR gas/9966
* listing.c (listing_newline): Properly handle `\\"' and ';'.
* read.c (is_end_of_line): Update comments for line separator.
(read_begin): Set line separator in is_end_of_line to 2.
Diffstat (limited to 'gas/listing.c')
-rw-r--r-- | gas/listing.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gas/listing.c b/gas/listing.c index 025a2ca674..e307be21c9 100644 --- a/gas/listing.c +++ b/gas/listing.c @@ -338,13 +338,18 @@ listing_newline (char *ps) char *copy; int len; int seen_quote = 0; + int seen_slash = 0; for (copy = input_line_pointer - 1; *copy && (seen_quote - || (! is_end_of_line [(unsigned char) *copy])); + || is_end_of_line [(unsigned char) *copy] != 1); copy++) - if (*copy == '"' && copy[-1] != '\\') - seen_quote = ! seen_quote; + { + if (*copy == '\\') + seen_slash = ! seen_slash; + else if (*copy == '"' && seen_slash) + seen_quote = ! seen_quote; + } len = (copy - input_line_pointer) + 2; |