]> granicus.if.org Git - p11-kit/commitdiff
Support /xxx/yyy as an absolute path with Win32
authorStef Walter <stefw@gnome.org>
Sat, 6 Apr 2013 14:41:08 +0000 (16:41 +0200)
committerStef Walter <stefw@gnome.org>
Tue, 21 May 2013 09:27:32 +0000 (11:27 +0200)
Because win32 code doesn't just run on windows, wine runs
with unix style paths.

common/path.c
common/tests/test-path.c

index bba2c231d0896a10d8bd81984cdb4cb35b772974..3f1fccccc756236e728b408f0c0216fc125ebdf1 100644 (file)
@@ -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 *
index 8263d1f18b73e2d18397342e20ab1c3388c30652..def4199fee42c04eff014d4e18ca97db8b0e64de 100644 (file)
@@ -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
 }