提交 c2d68ea6 编写于 作者: S Steve French

[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: NSteve French <sfrench@us.ibm.com>
上级 11b6d645
......@@ -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;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册