fix for crashes trying to resolve paths "location[]" or "location.."

This commit is contained in:
Campbell Barton
2010-12-01 09:12:54 +00:00
parent fd7728883a
commit 2ada145fa4

View File

@@ -3085,8 +3085,12 @@ int RNA_path_resolve_full(PointerRNA *ptr, const char *path, PointerRNA *r_ptr,
if (*path=='[') {
token= rna_path_token(&path, fixedbuf, sizeof(fixedbuf), 1);
if(token==NULL) {
/* invalid syntax blah[] */
return 0;
}
/* check for "" to see if it is a string */
if(rna_token_strip_quotes(token)) {
else if(rna_token_strip_quotes(token)) {
*index= RNA_property_array_item_index(prop, *(token+1));
}
else {
@@ -3096,6 +3100,10 @@ int RNA_path_resolve_full(PointerRNA *ptr, const char *path, PointerRNA *r_ptr,
}
else {
token= rna_path_token(&path, fixedbuf, sizeof(fixedbuf), 0);
if(token==NULL) {
/* invalid syntax blah.. */
return 0;
}
*index= RNA_property_array_item_index(prop, *token);
}