[Bf-blender-cvs] [657b92c888f] master: BLF: use existing stat from 'direntry' for directory check

Campbell Barton noreply at git.blender.org
Wed Aug 31 04:50:55 CEST 2022


Commit: 657b92c888f925a6721e30f1d43cb170b7908c12
Author: Campbell Barton
Date:   Wed Aug 31 12:42:41 2022 +1000
Branches: master
https://developer.blender.org/rB657b92c888f925a6721e30f1d43cb170b7908c12

BLF: use existing stat from 'direntry' for directory check

===================================================================

M	source/blender/blenfont/intern/blf_font_default.c

===================================================================

diff --git a/source/blender/blenfont/intern/blf_font_default.c b/source/blender/blenfont/intern/blf_font_default.c
index ffeee397c20..9ab5caf3d33 100644
--- a/source/blender/blenfont/intern/blf_font_default.c
+++ b/source/blender/blenfont/intern/blf_font_default.c
@@ -16,6 +16,10 @@
 
 #include "BKE_appdir.h"
 
+#ifdef WIN32
+#  include "BLI_winstuff.h"
+#endif
+
 static int blf_load_font_default(const char *filename, const bool unique)
 {
   const char *dir = BKE_appdir_folder_id(BLENDER_DATAFILES, BLF_DATAFILES_FONTS_DIR);
@@ -65,7 +69,7 @@ void BLF_load_font_stack()
     struct direntry *dir;
     uint num_files = BLI_filelist_dir_contents(path, &dir);
     for (int f = 0; f < num_files; f++) {
-      if (!BLI_is_dir(dir[f].path) &&
+      if (!S_ISDIR(dir[f].s.st_mode) &&
           BLI_path_extension_check_n(
               dir[f].path, ".ttf", ".ttc", ".otf", ".otc", ".woff", ".woff2", NULL)) {
         if (!BLF_is_loaded(dir[f].path)) {



More information about the Bf-blender-cvs mailing list