76 |
|
|
77 |
#include "ltdl.h" |
#include "ltdl.h" |
78 |
|
|
79 |
|
#define LT_DLSTRLEN(s) (((s) && (s)[0]) ? strlen (s) : 0) |
80 |
|
|
81 |
|
|
82 |
|
|
83 |
|
|
833 |
{ |
{ |
834 |
/* Append a `.' to stop Windows from adding an |
/* Append a `.' to stop Windows from adding an |
835 |
implicit `.dll' extension. */ |
implicit `.dll' extension. */ |
836 |
searchname = LT_DLMALLOC (char, 2+ strlen (filename)); |
searchname = LT_DLMALLOC (char, 2+ LT_DLSTRLEN (filename)); |
837 |
if (!searchname) |
if (!searchname) |
838 |
{ |
{ |
839 |
MUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); |
MUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); |
1284 |
/* The type of a function used at each iteration of foreach_dirinpath(). */ |
/* The type of a function used at each iteration of foreach_dirinpath(). */ |
1285 |
typedef int foreach_callback_func LT_PARAMS((char *filename, lt_ptr data1, |
typedef int foreach_callback_func LT_PARAMS((char *filename, lt_ptr data1, |
1286 |
lt_ptr data2)); |
lt_ptr data2)); |
1287 |
|
|
1288 |
static int foreach_dirinpath LT_PARAMS((const char *search_path, |
static int foreach_dirinpath LT_PARAMS((const char *search_path, |
1289 |
const char *base_name, |
const char *base_name, |
1290 |
foreach_callback_func *func, |
foreach_callback_func *func, |
1621 |
/* try to open the not-installed module */ |
/* try to open the not-installed module */ |
1622 |
if (!installed) |
if (!installed) |
1623 |
{ |
{ |
1624 |
len = (dir ? strlen (dir) : 0) + strlen (objdir) + strlen (dlname); |
len = LT_DLSTRLEN (dir) + strlen (objdir) + strlen (dlname); |
1625 |
filename = LT_DLMALLOC (char, 1+ len); |
filename = LT_DLMALLOC (char, 1+ len); |
1626 |
|
|
1627 |
if (!filename) |
if (!filename) |
1651 |
|
|
1652 |
/* maybe it was moved to another directory */ |
/* maybe it was moved to another directory */ |
1653 |
{ |
{ |
1654 |
len = (dir ? strlen (dir) : 0) + strlen (dlname); |
len = LT_DLSTRLEN (dir) + strlen (dlname); |
1655 |
filename = LT_DLMALLOC (char, 1+ len); |
filename = LT_DLMALLOC (char, 1+ len); |
1656 |
|
|
1657 |
if (dir) |
if (dir) |
1714 |
{ |
{ |
1715 |
int result = 0; |
int result = 0; |
1716 |
int filenamesize = 0; |
int filenamesize = 0; |
1717 |
int lenbase = base_name ? strlen (base_name) : 0; |
int lenbase = LT_DLSTRLEN (base_name); |
1718 |
char *filename, *canonical, *next; |
char *filename, *canonical, *next; |
1719 |
|
|
1720 |
MUTEX_LOCK (); |
MUTEX_LOCK (); |
2066 |
/* remove the leading and trailing "'" from str |
/* remove the leading and trailing "'" from str |
2067 |
and store the result in dest */ |
and store the result in dest */ |
2068 |
const char *end = strrchr (str, '\''); |
const char *end = strrchr (str, '\''); |
2069 |
int len = strlen (str); |
int len = LT_DLSTRLEN (str); |
2070 |
char *tmp; |
char *tmp; |
2071 |
|
|
2072 |
LT_DLFREE (*dest); |
LT_DLFREE (*dest); |
2555 |
|
|
2556 |
char *filename = 0; |
char *filename = 0; |
2557 |
int filenamesize = 0; |
int filenamesize = 0; |
2558 |
int lendir = strlen (dirname); |
int lendir = LT_DLSTRLEN (dirname); |
2559 |
DIR *dirp = opendir (dirname); |
DIR *dirp = opendir (dirname); |
2560 |
struct dirent *direntp; |
struct dirent *direntp; |
2561 |
|
|
2742 |
return 0; |
return 0; |
2743 |
} |
} |
2744 |
|
|
2745 |
lensym = strlen(symbol); |
lensym = strlen (symbol) + LT_DLSTRLEN (handle->loader->sym_prefix) |
2746 |
if (handle->loader->sym_prefix) |
+ LT_DLSTRLEN (handle->info.name); |
|
{ |
|
|
lensym += strlen(handle->loader->sym_prefix); |
|
|
} |
|
|
|
|
|
if (handle->info.name) |
|
|
{ |
|
|
lensym += strlen(handle->info.name); |
|
|
} |
|
2747 |
|
|
2748 |
if (lensym + LT_SYMBOL_OVERHEAD < LT_SYMBOL_LENGTH) |
if (lensym + LT_SYMBOL_OVERHEAD < LT_SYMBOL_LENGTH) |
2749 |
{ |
{ |