summaryrefslogtreecommitdiff
path: root/gas/macro.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2007-01-12 10:57:02 +0000
committerNick Clifton <nickc@redhat.com>2007-01-12 10:57:02 +0000
commitc1d2378e970d447f80b389a182b4db0c71fba424 (patch)
tree6d4795e6d8b94a7ccbbb827c05af1a0bf58d342c /gas/macro.c
parenta9cf33376c9e954dc7e1640cd0c8c95e38f21301 (diff)
downloadbinutils-redhat-c1d2378e970d447f80b389a182b4db0c71fba424.tar.gz
PR gas/3856
* macro.c (expand_irp): Do not ignore spaces inside quoted strings.
Diffstat (limited to 'gas/macro.c')
-rw-r--r--gas/macro.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/gas/macro.c b/gas/macro.c
index 67846eb2da..d7d470b764 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);
}
}