[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [32056] trunk/blender/source/blender/ makesrna/intern/rna_access.c: bugfix [#23514] Modifier names containing ']' character cant be animated.

Campbell Barton ideasman42 at gmail.com
Wed Sep 22 11:49:35 CEST 2010


Revision: 32056
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32056
Author:   campbellbarton
Date:     2010-09-22 11:49:35 +0200 (Wed, 22 Sep 2010)

Log Message:
-----------
bugfix [#23514] Modifier names containing ']' character cant be animated.

Modified Paths:
--------------
    trunk/blender/source/blender/makesrna/intern/rna_access.c

Modified: trunk/blender/source/blender/makesrna/intern/rna_access.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_access.c	2010-09-22 09:38:11 UTC (rev 32055)
+++ trunk/blender/source/blender/makesrna/intern/rna_access.c	2010-09-22 09:49:35 UTC (rev 32056)
@@ -2863,6 +2863,7 @@
 {
 	const char *p;
 	char *buf;
+	char quote= '\0';
 	int i, j, len, escape;
 
 	len= 0;
@@ -2874,11 +2875,32 @@
 
 		p= *path;
 
-		escape= 0;
-		while(*p && (*p != ']' || escape)) {
-			escape= (*p == '\\');
+		/* 2 kinds of lookups now, quoted or unquoted */
+		quote= *p;
+
+		if(quote != '\'' && quote != '"')
+			quote= 0;
+
+		if(quote==0) {
+			while(*p && (*p != ']')) {
+				len++;
+				p++;
+			}
+		}
+		else {
+			escape= 0;
+			/* skip the first quote */
 			len++;
 			p++;
+			while(*p && (*p != quote || escape)) {
+				escape= (*p == '\\');
+				len++;
+				p++;
+			}
+			
+			/* skip the last quoted char to get the ']' */
+			len++;
+			p++;
 		}
 
 		if(*p != ']') return NULL;
@@ -2906,7 +2928,7 @@
 	/* copy string, taking into account escaped ] */
 	if(bracket) {
 		for(p=*path, i=0, j=0; i<len; i++, p++) {
-			if(*p == '\\' && *(p+1) == ']');
+			if(*p == '\\' && *(p+1) == quote);
 			else buf[j++]= *p;
 		}
 





More information about the Bf-blender-cvs mailing list