[vlc-devel] [PATCH 6/9] win32: dirs-uap: simplify config_GetSysPath NULL checks

Steve Lhomme robux4 at ycbcr.xyz
Mon Apr 6 13:35:04 CEST 2020


---
 src/win32/dirs-uap.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/win32/dirs-uap.c b/src/win32/dirs-uap.c
index f35839a203a..5cdc379e524 100644
--- a/src/win32/dirs-uap.c
+++ b/src/win32/dirs-uap.c
@@ -140,10 +140,8 @@ char *config_GetSysPath(vlc_sysdir_t type, const char *filename)
             break;
         case VLC_PKG_LIB_DIR:
         case VLC_PKG_LIBEXEC_DIR:
-            dir = NULL;
-            break;
         case VLC_SYSDATA_DIR:
-            break;
+            return NULL;
         case VLC_LOCALE_DIR:
             dir = config_GetSysPath(VLC_PKG_DATA_DIR, "locale");
             break;
@@ -151,7 +149,10 @@ char *config_GetSysPath(vlc_sysdir_t type, const char *filename)
             vlc_assert_unreachable();
     }
 
-    if (filename == NULL || unlikely(dir == NULL))
+    if (unlikely(dir == NULL))
+        return NULL;
+
+    if (filename == NULL)
         return dir;
 
     char *path;
-- 
2.17.1



More information about the vlc-devel mailing list