changeset 129:2e1496dd96c4

Don't recognize macro argument parens or commas within quotes.
author David A. Holland
date Sun, 16 Jun 2013 22:06:57 -0400
parents 1cda505ddc78
children b4f97f6b32c2
files CHANGES macro.c
diffstat 2 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES	Fri Jun 14 20:59:24 2013 -0400
+++ b/CHANGES	Sun Jun 16 22:06:57 2013 -0400
@@ -3,6 +3,8 @@
      already in a false block; it might not be valid. Reported by
      Baptiste Daroussin.
    - Don't recognize comments within character constants.
+   - Don't recognize macro argument parentheses or commas within strings,
+     or within character constants either.
 
 release 0.2 (20130611)
    - auto-recognize more builtin PowerPC and mips macros
--- a/macro.c	Fri Jun 14 20:59:24 2013 -0400
+++ b/macro.c	Sun Jun 16 22:06:57 2013 -0400
@@ -1108,21 +1108,21 @@
 			continue;
 		}
 
-		if (buf[0] == '(') {
+		if (!inquote && buf[0] == '(') {
 			expand_got_lparen(es, p, buf, 1);
 			buf++;
 			len--;
 			continue;
 		}
 
-		if (buf[0] == ')') {
+		if (!inquote && buf[0] == ')') {
 			expand_got_rparen(es, p, buf, 1);
 			buf++;
 			len--;
 			continue;
 		}
 
-		if (buf[0] == ',') {
+		if (!inquote && buf[0] == ',') {
 			expand_got_comma(es, p, buf, 1);
 			buf++;
 			len--;