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:
Jeffrey Altman
2013-09-10 21:57:07 -04:00
parent 800da1a501
commit 31a00d6647
8 changed files with 41 additions and 8 deletions

View File

@@ -170,7 +170,7 @@ keytab_name(const char *name, const char **type, size_t *type_len)
residual = strchr(name, ':');
if (residual == NULL ||
name[0] == '/'
ISPATHSEP(name[0])
#ifdef _WIN32
/* Avoid treating <drive>:<path> as a keytab type
* specification */