Cleanup: remove inline pointcache extension stripping

No need to perform inline, and it would not have worked properly for
*.blend1 files.
This commit is contained in:
Campbell Barton
2023-05-05 09:25:43 +10:00
parent f2bbcc317f
commit 49c09d7640

View File

@@ -1312,7 +1312,6 @@ static int ptcache_path(PTCacheID *pid, char dirname[MAX_PTCACHE_PATH])
const char *blendfilename = (lib && (pid->cache->flag & PTCACHE_IGNORE_LIBPATH) == 0) ?
lib->filepath_abs :
blendfile_path;
size_t i;
if (pid->cache->flag & PTCACHE_EXTERNAL) {
BLI_strncpy(dirname, pid->cache->path, MAX_PTCACHE_PATH);
@@ -1327,12 +1326,8 @@ static int ptcache_path(PTCacheID *pid, char dirname[MAX_PTCACHE_PATH])
char file[MAX_PTCACHE_PATH]; /* we don't want the dir, only the file */
BLI_path_split_file_part(blendfilename, file, sizeof(file));
i = strlen(file);
/* remove .blend */
if (i > 6) {
file[i - 6] = '\0';
}
/* Remove the `.blend` extension. */
BLI_path_extension_strip(file);
/* Add blend file name to pointcache dir. */
BLI_snprintf(dirname, MAX_PTCACHE_PATH, "//" PTCACHE_PATH "%s", file);