/[libtool]/libtool/libltdl/ltdl.c
ViewVC logotype

Diff of /libtool/libltdl/ltdl.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.136 by gary, Tue Jun 26 00:53:37 2001 UTC revision 1.137 by gary, Tue Jun 26 01:06:00 2001 UTC
# Line 76  Foundation, Inc., 59 Temple Place, Suite Line 76  Foundation, Inc., 59 Temple Place, Suite
76    
77  #include "ltdl.h"  #include "ltdl.h"
78    
79    #define LT_DLSTRLEN(s)  (((s) && (s)[0]) ? strlen (s) : 0)
80    
81    
82    
83    
# Line 831  sys_wll_open (loader_data, filename) Line 833  sys_wll_open (loader_data, filename)
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));
# Line 1282  static struct lt_user_dlloader presym = Line 1284  static struct lt_user_dlloader presym =
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,
# Line 1618  find_module (handle, dir, libdir, dlname Line 1621  find_module (handle, dir, libdir, dlname
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)
# Line 1648  find_module (handle, dir, libdir, dlname Line 1651  find_module (handle, dir, libdir, dlname
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)
# Line 1711  foreach_dirinpath (search_path, base_nam Line 1714  foreach_dirinpath (search_path, base_nam
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 ();
# Line 2063  trim (dest, str) Line 2066  trim (dest, str)
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);
# Line 2552  foreachfile_callback (dirname, data1, da Line 2555  foreachfile_callback (dirname, data1, da
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    
# Line 2739  lt_dlsym (handle, symbol) Line 2742  lt_dlsym (handle, symbol)
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      {      {

Legend:
Removed from v.1.136  
changed lines
  Added in v.1.137

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26