mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-04-14 08:21:47 -04:00
dlopen: support search path ending in /
When the search path is /usr/lib/, /usr/lib/foo.so fails to load because there is no / after the search path. Fix this by requiring that either the search path end with / or the following char is a /.
This commit is contained in:
parent
14b74962d6
commit
0cc3644e55
2 changed files with 2 additions and 2 deletions
|
|
@ -265,7 +265,7 @@ static int load_ladspa_plugin(struct plugin *impl, const char *path, const char
|
|||
if (len == 0 || len >= sizeof(filename))
|
||||
continue;
|
||||
|
||||
if (strncmp(path, p, len) == 0 && path[len] == '/')
|
||||
if (strncmp(path, p, len) == 0 && (path[len-1] == '/' || path[len] == '/'))
|
||||
namelen = snprintf(filename, sizeof(filename), "%s", path);
|
||||
else
|
||||
namelen = snprintf(filename, sizeof(filename), "%.*s/%s.so", (int) len, p, path);
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ static inline int weakjack_load(struct weakjack *jack, const char *lib)
|
|||
if (len == 0 || len >= sizeof(path))
|
||||
continue;
|
||||
|
||||
if (strncmp(lib, p, len) == 0 && lib[len] == '/')
|
||||
if (strncmp(lib, p, len) == 0 && (lib[len-1] == '/' || lib[len] == '/'))
|
||||
pathlen = snprintf(path, sizeof(path), "%s", lib);
|
||||
else
|
||||
pathlen = snprintf(path, sizeof(path), "%.*s/%s", (int) len, p, lib);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue