Skip to content

Commit

Permalink
[CIFS] fix prepath conversion when server supports posix paths
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Steve French committed Feb 15, 2008
1 parent 11b6d64 commit c2d68ea
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion fs/cifs/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit c2d68ea

Please sign in to comment.