[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58381] trunk/blender/source/blender/ blenlib/intern/path_util.c: code cleanup: simplify BLI_parent_dir using BLI_join_dirfile
Campbell Barton
ideasman42 at gmail.com
Fri Jul 19 12:39:49 CEST 2013
Revision: 58381
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58381
Author: campbellbarton
Date: 2013-07-19 10:39:49 +0000 (Fri, 19 Jul 2013)
Log Message:
-----------
code cleanup: simplify BLI_parent_dir using BLI_join_dirfile
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-07-19 10:39:44 UTC (rev 58380)
+++ trunk/blender/source/blender/blenlib/intern/path_util.c 2013-07-19 10:39:49 UTC (rev 58381)
@@ -610,9 +610,8 @@
{
static char parent_dir[] = {'.', '.', SEP, '\0'}; /* "../" or "..\\" */
char tmp[FILE_MAX + 4];
- BLI_strncpy(tmp, path, sizeof(tmp) - 4);
- BLI_add_slash(tmp);
- strcat(tmp, parent_dir);
+
+ BLI_join_dirfile(tmp, sizeof(tmp), path, parent_dir);
BLI_cleanup_dir(NULL, tmp); /* does all the work of normalizing the path for us */
if (!BLI_testextensie(tmp, parent_dir)) {
More information about the Bf-blender-cvs
mailing list