ISPATHSEP and ISTILDE macros; Windows portability
Windows treats '\\' and '/' equivalently but we cannot control the form that will be used by end users. Introduce ISPATHSEP() macro which tests only for '/' on UNIX and both on Windows. Introduce ISTILDE() macro to test for '~'. When testing for '/' with strchr() or strrchr() add conditional checks for '\\' on Windows. Change-Id: Ia85e698fc88f15a6a71db649db5417f02ef7e5fe
This commit is contained in:
@@ -241,6 +241,10 @@ resolve_origin(const char *di)
|
||||
return strdup(LIBDIR "/plugin/krb5");
|
||||
|
||||
dname = dl_info.dli_fname;
|
||||
#ifdef _WIN32
|
||||
p = strrchr(dname, '\\');
|
||||
if (p == NULL)
|
||||
#endif
|
||||
p = strrchr(dname, '/');
|
||||
if (p)
|
||||
*p = '\0';
|
||||
|
Reference in New Issue
Block a user