* libltdl/ltdl.c (lt_dlopen): don't hardcode the length of the

constant strings
This commit is contained in:
Thomas Tanner 1999-03-09 23:00:24 +00:00
parent 305bdedf2a
commit adf5912c04
3 changed files with 26 additions and 9 deletions

View File

@ -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,

View 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

View 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;