Fix slashes while expanding path tokens
authorAsanka Herath <asanka@secure-endpoints.com>
Wed, 26 May 2010 14:23:03 +0000 (10:23 -0400)
committerAsanka Herath <asanka@secure-endpoints.com>
Wed, 26 May 2010 14:38:43 +0000 (10:38 -0400)
On Windows, some (external) APIs get confused if we mix both back and
forward slashes.  When expanding path tokens we use back-slashes for
token expansions because they come from the OS.  For consistency, fix
the path so that the remaining path separators are also backslashes.

lib/krb5/expand_path_w32.c

index 784ce64fec44ed78d61e7b8ded03ef0b439c5ff0..0c4287c32e8d1986ece223372ab6d62ed231cab6 100644 (file)
@@ -479,6 +479,14 @@ _krb5_expand_path_tokens(krb5_context context,
        }
     }
 
+    /* Also deal with slashes */
+    if (*ppath_out) {
+       char * c;
+       for (c = *ppath_out; *c; c++)
+           if (*c == '/')
+               *c = '\\';
+    }
+
     return 0;
 }