2000-06-13 Ulf Carlsson <ulfc@engr.sgi.com>
authorUlf Carlsson <ulfc@engr.sgi.com>
Wed, 14 Jun 2000 04:58:50 +0000 (04:58 +0000)
committerUlf Carlsson <ulfc@engr.sgi.com>
Wed, 14 Jun 2000 04:58:50 +0000 (04:58 +0000)
* macro.c (getstring): Make it possible to escape the quote
character.

gas/ChangeLog
gas/macro.c

index f305b253e58ccd79a34b78a4497206a9ca7ace95..98e8ec1d8897c1cc1926a7dced48d499cc890f03 100644 (file)
@@ -1,3 +1,8 @@
+2000-06-13  Ulf Carlsson  <ulfc@engr.sgi.com>
+
+       * macro.c (getstring): Make it possible to escape the quote
+       character.
+
 Tue Jun 13 20:58:28 2000  Catherine Moore <clm@redhat.com>
 
        * config/tc-hppa.c (pa_export): Weak symbols can be global.
index df01bc5ca0c43d5015ff1a8ffffa24227aea294a..3a0b6123062b8d5a951694485a9938ef028adcdf 100644 (file)
@@ -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)