]> err.no Git - linux-2.6/commitdiff
[CIFS] fix prepath conversion when server supports posix paths
authorSteve French <sfrench@us.ibm.com>
Fri, 15 Feb 2008 19:20:18 +0000 (19:20 +0000)
committerSteve French <sfrench@us.ibm.com>
Fri, 15 Feb 2008 19:20:18 +0000 (19:20 +0000)
Jeff Layton that we were converting \ to / in the posix path case which is
not always right (depends on what the old delim was).

CC: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/connect.c

index 77e6c4c3a88b80c160c32c965c0b6f848c702329..8dbfa97cd18ca6ae60ba6621e8e9214cb7a1641d 100644 (file)
@@ -1802,12 +1802,18 @@ static void
 convert_delimiter(char *path, char delim)
 {
        int i;
+       char old_delim;
 
        if (path == NULL)
                return;
 
+       if (delim == '/') 
+               old_delim = '\\';
+       else
+               old_delim = '/';
+
        for (i = 0; path[i] != '\0'; i++) {
-               if ((path[i] == '/') || (path[i] == '\\'))
+               if (path[i] == old_delim)
                        path[i] = delim;
        }
 }