fixed bug in handling quotes
[fw/sdcc] / src / SDCCmacro.c
index 9e0d87c0b5bb4ddb666291065a7a372e0a4ef216..7e112b04bb23bb64e5ccf3ec9fc577ceede1f32a 100644 (file)
@@ -46,6 +46,10 @@ _evalMacros(char *apinto, hTab *pvals, const char *pfrom, size_t alen)
     switch (*pfrom) {
     case '"':
     case '\'':
+      if (quote != '\0') {
+        /* write previous quote */
+        *pinto++ = quote;
+      }
       quote = *pfrom;
       ++pfrom;
       break;
@@ -104,6 +108,7 @@ _evalMacros(char *apinto, hTab *pvals, const char *pfrom, size_t alen)
           }
         }
 
+        quote = '\0';
         pfrom = pend + 1;
       }
       break;