diff options
author | Jan Beulich <jbeulich@suse.com> | 2024-05-24 12:22:54 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2024-05-24 12:22:54 +0200 |
commit | 69cab370cf666f2e7692158ac7dffc6a65207f4a (patch) | |
tree | 4dd137ffc1e93812fd03210c7baf545e88f9891c /gas/macro.c | |
parent | 6b15ec516579f8005e97d58ec06b1c98debf947b (diff) | |
download | gdb-69cab370cf666f2e7692158ac7dffc6a65207f4a.zip gdb-69cab370cf666f2e7692158ac7dffc6a65207f4a.tar.gz gdb-69cab370cf666f2e7692158ac7dffc6a65207f4a.tar.bz2 |
gas: adjust handling of quotes for .irpc
The present handling of inner double quotes can lead to very strange
diagnostics. Follow one of the two possible interpretations of the doc:
@dots{} referring to possibly multiple white space separated
@var{values}, each of which may be quoted. The original implementation,
prior to 465e5617233f ("PR gas/3856"), hints at the other possible
interpretation: When quoted there's only a single @var{values}, with
inner quotes taken as ordinary characters. That, however, seems overall
less useful to me.
While touching the documentation, mirror the (inverse) spelling
correction (@section line inconsistent with actual description) to .irp
as well.
Diffstat (limited to 'gas/macro.c')
-rw-r--r-- | gas/macro.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/gas/macro.c b/gas/macro.c index 3036e6a..077bb01 100644 --- a/gas/macro.c +++ b/gas/macro.c @@ -1369,12 +1369,6 @@ expand_irp (int irpc, size_t idx, sb *in, sb *out, size_t (*get_line) (sb *)) { bool in_quotes = false; - if (irpc && in->ptr[idx] == '"') - { - in_quotes = true; - ++idx; - } - while (idx < in->len) { if (!irpc) @@ -1383,16 +1377,14 @@ expand_irp (int irpc, size_t idx, sb *in, sb *out, size_t (*get_line) (sb *)) { if (in->ptr[idx] == '"') { - size_t nxt; + in_quotes = ! in_quotes; + ++idx; - if (irpc) - in_quotes = ! in_quotes; - - nxt = sb_skip_white (idx + 1, in); - if (nxt >= in->len) + if (! in_quotes) { - idx = nxt; - break; + idx = sb_skip_white (idx, in); + if (idx >= in->len) + break; } } sb_reset (&f.actual); |