texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]


From: Gavin D. Smith
Date: Thu, 21 Nov 2024 13:31:16 -0500 (EST)

branch: master
commit 6c9047bdb27003c61de698f14af6dd17cf37124b
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Thu Nov 21 17:48:36 2024 +0000

    * tp/Texinfo/XSLoader.pm (load_libtool_library);
    Add directories where loadable objects are expected to
    be found to front of search path rather than the end.
---
 ChangeLog              | 6 ++++++
 tp/Texinfo/XSLoader.pm | 7 +++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 54586061ee..89372c0821 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-11-21  Gavin Smith <gavinsmith0123@gmail.com>
+
+       * tp/Texinfo/XSLoader.pm (load_libtool_library);
+       Add directories where loadable objects are expected to
+       be found to front of search path rather than the end.
+
 2024-11-20  Gavin Smith <gavinsmith0123@gmail.com>
 
        * tp/Texinfo/XSLoader.pm (init): Use additional libraries
diff --git a/tp/Texinfo/XSLoader.pm b/tp/Texinfo/XSLoader.pm
index 5663372a06..9c0fcb9158 100644
--- a/tp/Texinfo/XSLoader.pm
+++ b/tp/Texinfo/XSLoader.pm
@@ -128,9 +128,12 @@ sub load_libtool_library {
     return 0;
   }
 
+  # Use unshift to place directories at start of search path.  This
+  # way we avoid accidentally loading the wrong library, e.g. if someone
+  # has some random /usr/lib/libtexinfo.so file.
   # The *.so file is under .libs in the source directory.
-  push @DynaLoader::dl_library_path, $libtool_dir;
-  push @DynaLoader::dl_library_path, "$libtool_dir/.libs";
+  unshift @DynaLoader::dl_library_path, "$libtool_dir/.libs";
+  unshift @DynaLoader::dl_library_path, $libtool_dir;
 
   my @found_files = DynaLoader::dl_findfile($dlname);
   if (scalar(@found_files) == 0) {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]