This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: PR gas/11356: "as -alm" returns very long lines
- From: Alan Modra <amodra at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Tue, 9 Mar 2010 11:09:46 +1030
- Subject: Re: PATCH: PR gas/11356: "as -alm" returns very long lines
- References: <20100308225139.GA20108@intel.com>
On Mon, Mar 08, 2010 at 02:51:39PM -0800, H.J. Lu wrote:
> My fix for PR 9966 didn't check EOL for `\`. This patc fixes it. OK
> to install?
No, your logic is still incorrect. A backslash quote always lasts for
exactly one char so the bug was that seen_slash stayed set. I think
the following is right.
PR gas/11356
* listing.c (listing_newline): Correct backslash quote logic.
Index: gas/listing.c
===================================================================
RCS file: /cvs/src/src/gas/listing.c,v
retrieving revision 1.46
diff -u -p -r1.46 listing.c
--- gas/listing.c 12 Jan 2010 01:10:55 -0000 1.46
+++ gas/listing.c 9 Mar 2010 00:36:10 -0000
@@ -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;
--
Alan Modra
Australia Development Lab, IBM