patch [#34103] path_util_split_dirstring.patch, path_util_split_dirstring_2.patch...
[blender.git] / source / blender / blenkernel / intern / packedFile.c
index cd3357a9281c38e95846faf69f0b7d0b11c244ad..ec13e58d4e01d5d8984e524cc2ec3a077b980b4d 100644 (file)
@@ -488,11 +488,8 @@ int unpackVFont(ReportList *reports, VFont *vfont, int how)
        int ret_value = RET_ERROR;
        
        if (vfont != NULL) {
-               BLI_strncpy(localname, vfont->name, sizeof(localname));
-               BLI_splitdirstring(localname, fi);
-               
+               BLI_split_file_part(vfont->name, fi, sizeof(fi));
                BLI_snprintf(localname, sizeof(localname), "//fonts/%s", fi);
-               
                newname = unpackFile(reports, vfont->name, localname, vfont->packedfile, how);
                if (newname != NULL) {
                        ret_value = RET_OK;
@@ -513,10 +510,8 @@ int unpackSound(Main *bmain, ReportList *reports, bSound *sound, int how)
        int ret_value = RET_ERROR;
 
        if (sound != NULL) {
-               BLI_strncpy(localname, sound->name, sizeof(localname));
-               BLI_splitdirstring(localname, fi);
+               BLI_split_file_part(sound->name, fi, sizeof(fi));
                BLI_snprintf(localname, sizeof(localname), "//sounds/%s", fi);
-
                newname = unpackFile(reports, sound->name, localname, sound->packedfile, how);
                if (newname != NULL) {
                        BLI_strncpy(sound->name, newname, sizeof(sound->name));
@@ -541,10 +536,8 @@ int unpackImage(ReportList *reports, Image *ima, int how)
        int ret_value = RET_ERROR;
        
        if (ima != NULL && ima->name[0]) {
-               BLI_strncpy(localname, ima->name, sizeof(localname));
-               BLI_splitdirstring(localname, fi);
+               BLI_split_file_part(ima->name, fi, sizeof(fi));
                BLI_snprintf(localname, sizeof(localname), "//textures/%s", fi);
-
                newname = unpackFile(reports, ima->name, localname, ima->packedfile, how);
                if (newname != NULL) {
                        ret_value = RET_OK;