diff options
author | Ulf Carlsson <ulfc@engr.sgi.com> | 2000-06-14 04:58:50 +0000 |
---|---|---|
committer | Ulf Carlsson <ulfc@engr.sgi.com> | 2000-06-14 04:58:50 +0000 |
commit | 66b2860980f73db197136c3dc2bfd50bbbbdfe6b (patch) | |
tree | fbe0c467889a4b57b01cdc3c1e79ab39974df5e2 /gas/macro.c | |
parent | ac60d8887934053a638b002af063a6ff6005d573 (diff) | |
download | binutils-redhat-66b2860980f73db197136c3dc2bfd50bbbbdfe6b.tar.gz |
2000-06-13 Ulf Carlsson <ulfc@engr.sgi.com>
* macro.c (getstring): Make it possible to escape the quote
character.
Diffstat (limited to 'gas/macro.c')
-rw-r--r-- | gas/macro.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gas/macro.c b/gas/macro.c index df01bc5ca0..3a0b612306 100644 --- a/gas/macro.c +++ b/gas/macro.c @@ -304,14 +304,25 @@ getstring (idx, in, acc) else if (in->ptr[idx] == '"' || in->ptr[idx] == '\'') { char tchar = in->ptr[idx]; + int escaped = 0; idx++; while (idx < in->len) { + if (in->ptr[idx-1] == '\\') + escaped ^= 1; + else + escaped = 0; + if (macro_alternate && in->ptr[idx] == '!') { idx++ ; sb_add_char (acc, in->ptr[idx++]); } + else if (escaped && in->ptr[idx] == tchar) + { + sb_add_char (acc, tchar); + idx++; + } else { if (in->ptr[idx] == tchar) |