+2007-09-05 Eric Blake <ebb9@byu.net>
+
+ * libltdl/ltdl.c (lt_dlcaller_get_data): Work even when no caller
+ has set data.
+
2007-09-04 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* doc/libtool.texi (User defined module data)
/* Handle the case where we occasionally need to read a line
that is longer than the initial buffer size.
- Behave even if the file contains NUL bytes due to corruption. */
+ Behave even if the file contains NUL bytes due to corruption. */
while (line[line_len-2] != '\0' && line[line_len-2] != '\n' && !feof (file))
{
line = REALLOC (char, line, line_len *2);
}
void *
-lt_dlcaller_get_data (lt_dlinterface_id key, lt_dlhandle handle)
+lt_dlcaller_get_data (lt_dlinterface_id key, lt_dlhandle handle)
{
void *result = (void *) 0;
lt__handle *cur = (lt__handle *) handle;
/* Locate the index of the element with a matching KEY. */
- {
- int i;
- for (i = 0; cur->interface_data[i].key; ++i)
- {
- if (cur->interface_data[i].key == key)
- {
- result = cur->interface_data[i].data;
- break;
- }
- }
- }
+ if (cur->interface_data)
+ {
+ int i;
+ for (i = 0; cur->interface_data[i].key; ++i)
+ {
+ if (cur->interface_data[i].key == key)
+ {
+ result = cur->interface_data[i].data;
+ break;
+ }
+ }
+ }
return result;
}