[vlc-commits] win32: dirs-uap: simplify config_GetSysPath NULL checks

Steve Lhomme git at videolan.org
Thu Apr 9 07:52:03 CEST 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Apr  6 13:05:54 2020 +0200| [f96c68f8582182c20abebfaacd5bf433498d0e05] | committer: Steve Lhomme

win32: dirs-uap: simplify config_GetSysPath NULL checks

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f96c68f8582182c20abebfaacd5bf433498d0e05
---

 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 4b97f36e4b..c3869f3f57 100644
--- a/src/win32/dirs-uap.c
+++ b/src/win32/dirs-uap.c
@@ -132,10 +132,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;
@@ -143,7 +141,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;



More information about the vlc-commits mailing list