Ignore:
Timestamp:
Jan 12, 2010, 7:38:34 PM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Better fix for hardcoded \lib directory in 3.0.x

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.0/source/dynconfig.c

    r363 r366  
    140140 **/
    141141// we try to set the libdir based on the current running process
    142 const char* getlibdir()
     142const char * getlibdir()
    143143{
    144         static pstring buffer = "";
    145         if (!*buffer)
    146         {
    147 
    148                 if (getenv("SMB_EXE") == NULL)
    149                 {
    150                         snprintf(buffer, 260, "%s", LIBDIR);
    151                 } else {
    152                         snprintf(buffer, 260, "%s/lib", getenv("SMB_EXE"));
    153                 }
    154         }
    155 
    156         return buffer;
     144        static pstring buffer = "";
     145        if (!*buffer)
     146        {
     147                pstring exedir = "";
     148                if (os2_GetExePath(exedir) != 0)
     149                {
     150                        snprintf(buffer, 260, "%s", LIBDIR);
     151                } else {
     152                        snprintf(buffer, 260, "%s/%s", exedir, "lib");
     153                }
     154        }
     155        return buffer;
    157156}
    158157
Note: See TracChangeset for help on using the changeset viewer.