From 49c09d76404be04065e047f3dafcd4377562c2f5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 5 May 2023 09:25:43 +1000 Subject: [PATCH] Cleanup: remove inline pointcache extension stripping No need to perform inline, and it would not have worked properly for *.blend1 files. --- source/blender/blenkernel/intern/pointcache.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 35d6ecbc4ca..8bad91e54ee 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -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);