]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libltdl/ltdl.c (lt_dlopen): don't hardcode the length of the
authorThomas Tanner <tanner@gmx.de>
Tue, 9 Mar 1999 23:00:24 +0000 (23:00 +0000)
committerThomas Tanner <tanner@gmx.de>
Tue, 9 Mar 1999 23:00:24 +0000 (23:00 +0000)
  constant strings

ChangeLog
libltdl/configure.in
libltdl/ltdl.c

index 885f64a596a457739908ccea86dcc255cda87e03..33ce986422e5b71b411e5efcfa0f6d52d006b3ba 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+1999-03-09  Thomas Tanner  <tanner@gmx.de>
+
+       * libltdl/ltdl.c (lt_dlopen): don't hardcode the length of the
+         constant strings
+
 1999-03-09  Alexandre Oliva  <oliva@dcc.unicamp.br>
 
        * Makefile.am (install-data-hook): install libltdl as a directory, 
index 93afeedf2fe279baf0345d6ae23233a77c711cdf..a1156eb77232c2a23242f0d61345e1193995aa09 100644 (file)
@@ -10,7 +10,7 @@ TOINST=toinst
 AC_SUBST(TOINST)
 
 if test -z "$enable_ltdl_install$enable_ltdl_convenience"; then
-  AC_MSG_WARN([*** Neither AC_LIBLTDL_INSTALLABLE nor AC_LIBLTDL_CONVENIENCE wre used])
+  AC_MSG_WARN([*** Neither AC_LIBLTDL_INSTALLABLE nor AC_LIBLTDL_CONVENIENCE were used])
   AC_MSG_WARN([*** in configure.in; building convenience library for backward])
   AC_MSG_WARN([*** compatibility.  This is deprecated, and will not work in the future])
   enable_ltdl_convenience=yes
index 63bb2be56c39b67197f005b2fc8a291d2415bedf..b05150694ca8f7d248e6314e096731d2f8c96d5d 100644 (file)
@@ -1142,23 +1142,35 @@ lt_dlopen (filename)
                }
                /* read the .la file */
                while (!feof(file)) {
+                       #define STR_DLNAME      "dlname="
+                       #define STR_OLD_LIBRARY "old_library="
+                       #define STR_LIBDIR      "libdir="
+                       #define STR_DL_DEPLIBS  "dl_dependency_libs="
                        char    line[LTDL_FILENAME_MAX];
                        
                        if (!fgets(line, sizeof(line), file))
                                break;
                        if (line[0] == '\n' || line[0] == '#')
                                continue;
-                       if (strncmp(line, "dlname=", 7) == 0)
-                               error = trim(&dlname, &line[7]);
+                       if (strncmp(line, STR_DLNAME,
+                               sizeof(STR_DLNAME) - 1) == 0)
+                               error = trim(&dlname,
+                                       &line[sizeof(STR_DLNAME) - 1]);
                        else
-                       if (strncmp(line, "old_library=", 12) == 0)
-                               error = trim(&old_name, &line[12]);
+                       if (strncmp(line, STR_OLD_LIBRARY,
+                               sizeof(STR_OLD_LIBRARY) - 1) == 0)
+                               error = trim(&old_name,
+                                       &line[sizeof(STR_OLD_LIBRARY) - 1]);
                        else
-                       if (strncmp(line, "libdir=", 7) == 0)
-                               error = trim(&libdir, &line[7]);
+                       if (strncmp(line, STR_LIBDIR,
+                               sizeof(STR_LIBDIR) - 1) == 0)
+                               error = trim(&libdir,
+                                       &line[sizeof(STR_LIBDIR) - 1]);
                        else
-                       if (strncmp(line, "dl_dependency_libs=", 20) == 0)
-                               error = trim(&deplibs, &line[20]);
+                       if (strncmp(line, STR_DL_DEPLIBS,
+                               sizeof(STR_DL_DEPLIBS) - 1) == 0)
+                               error = trim(&deplibs,
+                                       &line[sizeof(STR_DL_DEPLIBS) - 1]);
                        else
                        if (strcmp(line, "installed=yes\n") == 0)
                                installed = 1;