From: Stef Walter Date: Sat, 6 Apr 2013 14:41:08 +0000 (+0200) Subject: Support /xxx/yyy as an absolute path with Win32 X-Git-Tag: 0.19.1~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7b848defc704cc1fbb47a16b23727583c14b804d;p=p11-kit Support /xxx/yyy as an absolute path with Win32 Because win32 code doesn't just run on windows, wine runs with unix style paths. --- 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 }