summaryrefslogtreecommitdiff
path: root/libguile/dynl.c
diff options
context:
space:
mode:
authorIsaac Jurado <diptongo@gmail.com>2019-06-08 14:00:29 +0200
committerLudovic Courtès <ludo@gnu.org>2020-03-22 00:27:12 +0100
commitbef5e0b3938cc88e3a1a1ac590b009875cc38162 (patch)
treeae0d34d4bb1c83c755d24e5899d316690c4554f0 /libguile/dynl.c
parent87bf38c93a7baa4f2c060c24d8e2d354f4771861 (diff)
downloadguile-bef5e0b3938cc88e3a1a1ac590b009875cc38162.tar.gz
Interpret dynamic library name as literal file name first.
Fixes <https://bugs.gnu.org/21076>. * libguile/dynl.c (sysdep_dyn_link): Try plain lt_dlopen first, to interpret fname as a literal path. * doc/ref/api-foreign.texi: Update explanation to describe the new behavior. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'libguile/dynl.c')
-rw-r--r--libguile/dynl.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libguile/dynl.c b/libguile/dynl.c
index bf7163c38..e9c03e95b 100644
--- a/libguile/dynl.c
+++ b/libguile/dynl.c
@@ -64,10 +64,9 @@ sysdep_dynl_link (const char *fname, const char *subr)
{
lt_dlhandle handle;
- if (fname == NULL)
- /* Return a handle for the program as a whole. */
- handle = lt_dlopen (NULL);
- else
+ /* Try the literal filename first or, if NULL, the program itself */
+ handle = lt_dlopen (fname);
+ if (handle == NULL)
{
handle = lt_dlopenext (fname);