diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-09-22 13:49:35 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-09-22 13:49:35 +0400 |
commit | b27d924aac68e6a9bd10204e458f9a9594ce8c21 (patch) | |
tree | 03881a4210d0061dd9006de12d3e639ca53cb49b /source/blender/makesrna/intern/rna_access.c | |
parent | b6d28b585001bcee99e60660454313ca63d104c4 (diff) |
bugfix [#23514] Modifier names containing ']' character cant be animated.
Diffstat (limited to 'source/blender/makesrna/intern/rna_access.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 9c4ab59d827..856f34e5660 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -2863,6 +2863,7 @@ static char *rna_path_token(const char **path, char *fixedbuf, int fixedlen, int { const char *p; char *buf; + char quote= '\0'; int i, j, len, escape; len= 0; @@ -2874,9 +2875,30 @@ static char *rna_path_token(const char **path, char *fixedbuf, int fixedlen, int 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++; } @@ -2906,7 +2928,7 @@ static char *rna_path_token(const char **path, char *fixedbuf, int fixedlen, int /* 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; } |