Page MenuHome

path_util_split_name_num.patch

path_util_split_name_num.patch

commit 601acbb801bd8aea1c3a4440ea7f709795859945
Author: Lawrence D'Oliveiro <ldo@geek-central.gen.nz>
Date: Thu Feb 14 03:43:02 2013 +0000
Simplify implementation of BLI_split_name_num
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index a90cad6..ac35f51 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -174,21 +174,20 @@ int BLI_split_name_num
while (a--) {
if (name[a] == delim) {
- left[a] = 0;
+ left[a] = 0; /* truncate left part here */
*nr = atol(name + a + 1);
/* casting down to an int, can overflow for large numbers */
if (*nr < 0)
*nr = 0;
return a;
}
- if (isdigit(name[a]) == 0) break; /* non-numeric suffix--give up */
-
- left[a] = 0;
+ if (isdigit(name[a]) == 0)
+ { /* non-numeric suffix--give up */
+ a = strlen(name);
+ break;
+ } /*if*/
}
- for (a = 0; name[a]; a++)
- left[a] = name[a];
-
return a;
}

File Metadata

Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
76/2c/33dff3be40e5a31cb42fdf7cf2ba

Event Timeline