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);