From 465e5617233fc7b7278fe82fddeb6f19064c7338 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 12 Jan 2007 10:57:02 +0000 Subject: [PATCH] PR gas/3856 * macro.c (expand_irp): Do not ignore spaces inside quoted strings. --- gas/ChangeLog | 6 ++++++ gas/macro.c | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index ab907bff6db..09b11b00657 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2007-01-12 Nick Clifton + + PR gas/3856 + * macro.c (expand_irp): Do not ignore spaces inside quoted + strings. + 2007-01-12 Alan Modra * config/tc-spu.h (TC_RELOC_RTSYM_LOC_FIXUP): Delete. diff --git a/gas/macro.c b/gas/macro.c index 67846eb2daa..d7d470b764e 100644 --- a/gas/macro.c +++ b/gas/macro.c @@ -1325,8 +1325,14 @@ expand_irp (int irpc, int idx, sb *in, sb *out, int (*get_line) (sb *)) } else { + bfd_boolean in_quotes = FALSE; + if (irpc && in->ptr[idx] == '"') - ++idx; + { + in_quotes = TRUE; + ++idx; + } + while (idx < in->len) { if (!irpc) @@ -1337,6 +1343,9 @@ expand_irp (int irpc, int idx, sb *in, sb *out, int (*get_line) (sb *)) { int nxt; + if (irpc) + in_quotes = ! in_quotes; + nxt = sb_skip_white (idx + 1, in); if (nxt >= in->len) { @@ -1348,12 +1357,13 @@ expand_irp (int irpc, int idx, sb *in, sb *out, int (*get_line) (sb *)) sb_add_char (&f.actual, in->ptr[idx]); ++idx; } + err = macro_expand_body (&sub, out, &f, h, 0); if (err != NULL) break; if (!irpc) idx = sb_skip_comma (idx, in); - else + else if (! in_quotes) idx = sb_skip_white (idx, in); } } -- 2.30.2