[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55602] trunk/blender/source/blender/ blenlib/intern/path_util.c: Fix regression introduced by svn rev55545
Sergey Sharybin
sergey.vfx at gmail.com
Tue Mar 26 16:52:44 CET 2013
Revision: 55602
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55602
Author: nazgul
Date: 2013-03-26 15:52:43 +0000 (Tue, 26 Mar 2013)
Log Message:
-----------
Fix regression introduced by svn rev55545
After this revision BLI_stringdec worked incorrect
in cases there's no digits in original file name,
making head one character shorter than it should be.
Time to cover BLI with unit-tests?
Revision Links:
--------------
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55545
Modified Paths:
--------------
trunk/blender/source/blender/blenlib/intern/path_util.c
Modified: trunk/blender/source/blender/blenlib/intern/path_util.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/path_util.c 2013-03-26 15:48:20 UTC (rev 55601)
+++ trunk/blender/source/blender/blenlib/intern/path_util.c 2013-03-26 15:52:43 UTC (rev 55602)
@@ -135,7 +135,10 @@
else {
if (tail) strcpy(tail, string + name_end);
if (head) {
- BLI_strncpy(head, string, name_end);
+ /* name_end points to last character of head,
+ * make it +1 so null-terminator is nicely placed
+ */
+ BLI_strncpy(head, string, name_end + 1);
}
if (numlen) *numlen = 0;
return 0;
More information about the Bf-blender-cvs
mailing list