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:
@@ -375,4 +375,11 @@ enum krb5_pk_type {
|
||||
|
||||
#endif /* PKINIT */
|
||||
|
||||
#define ISTILDE(x) (x == '~')
|
||||
#ifdef _WIN32
|
||||
# define ISPATHSEP(x) (x == '/' || x =='\\')
|
||||
#else
|
||||
# define ISPATHSEP(x) (x == '/')
|
||||
#endif
|
||||
|
||||
#endif /* __KRB5_LOCL_H__ */
|
||||
|
Reference in New Issue
Block a user