diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/path.c | 8 | ||||
-rw-r--r-- | common/tests/test-path.c | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/common/path.c b/common/path.c index bba2c23..3f1fccc 100644 --- a/common/path.c +++ b/common/path.c @@ -201,11 +201,11 @@ p11_path_absolute (const char *path) { return_val_if_fail (path != NULL, false); -#ifdef OS_UNIX - return (path[0] == '/'); -#else - return (path[0] != '\0' && path[1] == ':' && path[2] == '\\'); + return (path[0] == '/') +#ifdef OS_WIN32 + || (path[0] != '\0' && path[1] == ':' && path[2] == '\\') #endif + ; } char * diff --git a/common/tests/test-path.c b/common/tests/test-path.c index 8263d1f..def4199 100644 --- a/common/tests/test-path.c +++ b/common/tests/test-path.c @@ -174,7 +174,7 @@ test_absolute (CuTest *tc) #else /* OS_WIN32 */ CuAssertTrue (tc, p11_path_absolute ("C:\\home")); CuAssertTrue (tc, !p11_path_absolute ("home")); - CuAssertTrue (tc, !p11_path_absolute ("/home")); + CuAssertTrue (tc, p11_path_absolute ("/home")); #endif } |