[vlc-devel] [PATCH] linux/dirs: remove legacy code

Zhao Zhili quinkblack at qq.com
Sat Nov 3 16:58:50 CET 2018


---
Please use the attachment if the email is not plain text.

 src/linux/dirs.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/linux/dirs.c b/src/linux/dirs.c
index f5dbdaaf2c..5366a9d705 100644
--- a/src/linux/dirs.c
+++ b/src/linux/dirs.c
@@ -37,7 +37,7 @@ static char *config_GetLibDirRaw(void)
     /* Find the path to libvlc (i.e. ourselves) */
     FILE *maps = fopen ("/proc/self/maps", "rte");
     if (maps == NULL)
-        goto error;
+        return strdup(LIBDIR);
 
     char *line = NULL;
     size_t linelen = 0;
@@ -60,9 +60,7 @@ static char *config_GetLibDirRaw(void)
         if (dir == NULL)
             continue;
 
-        char *file = strrchr (line, '/');
-        if (end == NULL)
-            continue;
+        char *file = strrchr (dir, '/');
         *file = '\0';
 
         path = strdup(dir);
@@ -71,7 +69,6 @@ static char *config_GetLibDirRaw(void)
 
     free (line);
     fclose (maps);
-error:
     if (path == NULL)
         path = strdup(LIBDIR);
     return path;
-- 
2.19.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-linux-dirs-remove-legacy-code.patch
Type: application/octet-stream
Size: 1188 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20181103/bd20d2d7/attachment.obj>


More information about the vlc-devel mailing list