From: Steve French Date: Fri, 15 Feb 2008 19:20:18 +0000 (+0000) Subject: [CIFS] fix prepath conversion when server supports posix paths X-Git-Tag: v2.6.25-rc4~105^2~8 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2d68ea65b0f668783c88e1f4f22738b24f3edea;p=linux-2.6 [CIFS] fix prepath conversion when server supports posix paths 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 Signed-off-by: Steve French --- diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 77e6c4c3a8..8dbfa97cd1 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -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; } }