From 7b848defc704cc1fbb47a16b23727583c14b804d Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Sat, 6 Apr 2013 16:41:08 +0200 Subject: Support /xxx/yyy as an absolute path with Win32 Because win32 code doesn't just run on windows, wine runs with unix style paths. --- common/path.c | 8 ++++---- 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 } -- cgit v1.1