Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenlib/intern/path_util.c
| Context not available. | |||||
| } | } | ||||
| if (found_digit) { | if (found_digit) { | ||||
| if (tail) strcpy(tail, &string[nume + 1]); | char *ptr; | ||||
| if (head) { | long ret; | ||||
| strcpy(head, string); | ret = strtol(&(string[nums]), &ptr, 10); | ||||
| head[nums] = 0; | if (ret >= INT_MIN && ret <= INT_MAX) { | ||||
| if (tail) strcpy(tail, &string[nume + 1]); | |||||
| if (head) { | |||||
| strcpy(head, string); | |||||
| head[nums] = 0; | |||||
| } | |||||
| if (numlen) *numlen = nume - nums + 1; | |||||
| return ((int)ret); | |||||
| } | } | ||||
| if (numlen) *numlen = nume - nums + 1; | |||||
| return ((int)atoi(&(string[nums]))); | |||||
| } | } | ||||
| else { | |||||
| if (tail) strcpy(tail, string + name_end); | if (tail) strcpy(tail, string + name_end); | ||||
| if (head) { | if (head) { | ||||
| /* name_end points to last character of head, | /* name_end points to last character of head, | ||||
| * make it +1 so null-terminator is nicely placed | * make it +1 so null-terminator is nicely placed | ||||
| */ | */ | ||||
| BLI_strncpy(head, string, name_end + 1); | BLI_strncpy(head, string, name_end + 1); | ||||
| } | |||||
| if (numlen) *numlen = 0; | |||||
| return 0; | |||||
| } | } | ||||
| if (numlen) *numlen = 0; | |||||
| return 0; | |||||
| } | } | ||||
| Context not available. | |||||