diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-28 12:42:19 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-28 12:42:19 +0400 |
commit | 30d128c7a723bb6ed68c763d175c845e1cfa3c4f (patch) | |
tree | eee1b8c2da135465b9fc444c133b499d68850b9e /source/blender/bmesh/intern/bmesh_operators.c | |
parent | 8aa42f309c2c205035b34c874de6e7b5170b22b5 (diff) |
bmesh: be more strict with operator string formatting, no tabs and only accept slot=%x style.
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_operators.c')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_operators.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/source/blender/bmesh/intern/bmesh_operators.c b/source/blender/bmesh/intern/bmesh_operators.c index 4c38ccacb31..d658b9a5bf2 100644 --- a/source/blender/bmesh/intern/bmesh_operators.c +++ b/source/blender/bmesh/intern/bmesh_operators.c @@ -1264,8 +1264,8 @@ int BMO_op_vinitf(BMesh *bm, BMOperator *op, const char *_fmt, va_list vlist) /* 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 @@ int BMO_op_vinitf(BMesh *bm, BMOperator *op, const char *_fmt, va_list vlist) 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 @@ int BMO_op_vinitf(BMesh *bm, BMOperator *op, const char *_fmt, va_list vlist) else { switch (*fmt) { case ' ': - case '\t': case '=': case '%': break; @@ -1377,7 +1374,7 @@ int BMO_op_vinitf(BMesh *bm, BMOperator *op, const char *_fmt, va_list vlist) 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 { |