[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [45237] trunk/blender/source/blender/bmesh /intern/bmesh_operators.c: bmesh: be more strict with operator string formatting, no tabs and only accept slot=%x style.

Campbell Barton ideasman42 at gmail.com
Wed Mar 28 10:42:30 CEST 2012


Revision: 45237
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45237
Author:   campbellbarton
Date:     2012-03-28 08:42:19 +0000 (Wed, 28 Mar 2012)
Log Message:
-----------
bmesh: be more strict with operator string formatting, no tabs and only accept slot=%x style.

Modified Paths:
--------------
    trunk/blender/source/blender/bmesh/intern/bmesh_operators.c

Modified: trunk/blender/source/blender/bmesh/intern/bmesh_operators.c
===================================================================
--- trunk/blender/source/blender/bmesh/intern/bmesh_operators.c	2012-03-28 08:00:58 UTC (rev 45236)
+++ trunk/blender/source/blender/bmesh/intern/bmesh_operators.c	2012-03-28 08:42:19 UTC (rev 45237)
@@ -1264,8 +1264,8 @@
 	/* we muck around in here, so dup i */
 	fmt = ofmt = BLI_strdup(_fmt);
 	
-	/* find operator nam */
-	i = strcspn(fmt, " \t");
+	/* find operator name */
+	i = strcspn(fmt, " ");
 
 	opname = fmt;
 	if (!opname[i]) noslot = 1;
@@ -1289,17 +1289,15 @@
 	while (*fmt) {
 		if (state) {
 			/* jump past leading whitespac */
-			i = strspn(fmt, " \t");
+			i = strspn(fmt, " ");
 			fmt += i;
 			
 			/* ignore trailing whitespac */
 			if (!fmt[i])
 				break;
 
-			/* find end of slot name.  currently this is
-			 * a little flexible, allowing "slot=%f",
-			 * "slot %f", "slot%f", and "slot\t%f". */
-			i = strcspn(fmt, "= \t%");
+			/* find end of slot name, only "slot=%f", can be used */
+			i = strcspn(fmt, "=");
 			if (!fmt[i]) {
 				GOTO_ERROR("could not match end of slot name");
 			}
@@ -1318,7 +1316,6 @@
 		else {
 			switch (*fmt) {
 				case ' ':
-				case '\t':
 				case '=':
 				case '%':
 					break;
@@ -1377,7 +1374,7 @@
 				case 'a':
 					type = *fmt;
 
-					if (NEXT_CHAR(fmt) == ' ' || NEXT_CHAR(fmt) == '\t' || NEXT_CHAR(fmt) == '\0') {
+					if (NEXT_CHAR(fmt) == ' ' || NEXT_CHAR(fmt) == '\0') {
 						BMO_slot_float_set(op, slotname, va_arg(vlist, double));
 					}
 					else {




More information about the Bf-blender-cvs mailing list