aboutsummaryrefslogtreecommitdiff
path: root/gas/listing.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2010-03-09 00:41:24 +0000
committerAlan Modra <amodra@gmail.com>2010-03-09 00:41:24 +0000
commit4199fe1239b2fdbbf552f85524e0f9dafd61e100 (patch)
treec9b402ccdd8c8d5485530b965f0597ae2d77f5c9 /gas/listing.c
parent840a467a0af6d363b0367f89bbfd92fc78786b2e (diff)
downloadgdb-4199fe1239b2fdbbf552f85524e0f9dafd61e100.zip
gdb-4199fe1239b2fdbbf552f85524e0f9dafd61e100.tar.gz
gdb-4199fe1239b2fdbbf552f85524e0f9dafd61e100.tar.bz2
PR gas/11356
* listing.c (listing_newline): Correct backslash quote logic.
Diffstat (limited to 'gas/listing.c')
-rw-r--r--gas/listing.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gas/listing.c b/gas/listing.c
index 9a71c76..002b3c5 100644
--- a/gas/listing.c
+++ b/gas/listing.c
@@ -347,10 +347,12 @@ listing_newline (char *ps)
|| is_end_of_line [(unsigned char) *copy] != 1);
copy++)
{
- if (*copy == '\\')
- seen_slash = ! seen_slash;
- else if (*copy == '"' && seen_slash)
- seen_quote = ! seen_quote;
+ if (seen_slash)
+ seen_slash = 0;
+ else if (*copy == '\\')
+ seen_slash = 1;
+ else if (*copy == '"')
+ seen_quote = !seen_quote;
}
len = copy - input_line_pointer + 1;