diff options
author | Steve French <sfrench@us.ibm.com> | 2008-02-15 19:20:18 +0000 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2008-02-15 19:20:18 +0000 |
commit | c2d68ea65b0f668783c88e1f4f22738b24f3edea (patch) | |
tree | fbc55d738f857c37f63df2f674b6f2d40ab6e376 | |
parent | 11b6d6450c10066e83e19f6ff57d55678c3e9f13 (diff) | |
download | blackbird-op-linux-c2d68ea65b0f668783c88e1f4f22738b24f3edea.tar.gz blackbird-op-linux-c2d68ea65b0f668783c88e1f4f22738b24f3edea.zip |
[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 <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
-rw-r--r-- | fs/cifs/connect.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 77e6c4c3a88b..8dbfa97cd18c 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; } } |