Fix checking of directory access for "/foo". The parent directory is
"/", not "".
This commit is contained in:
parent
e0acfb2a48
commit
5ab11f181a
@ -749,7 +749,7 @@ recvrequest(cmd, local, remote, lmode, printnames)
|
||||
}
|
||||
if (dir != NULL)
|
||||
*dir = 0;
|
||||
d = access(dir ? local : ".", 2);
|
||||
d = access(dir == local ? "/" : dir ? local : ".", 2);
|
||||
if (dir != NULL)
|
||||
*dir = '/';
|
||||
if (d < 0) {
|
||||
@ -1445,7 +1445,7 @@ gunique(local)
|
||||
|
||||
if (cp)
|
||||
*cp = '\0';
|
||||
d = access(cp ? local : ".", 2);
|
||||
d = access(cp == local ? "/" : cp ? local : ".", 2);
|
||||
if (cp)
|
||||
*cp = '/';
|
||||
if (d < 0) {
|
||||
|
@ -220,6 +220,8 @@ tail(filename)
|
||||
break;
|
||||
if (s[1])
|
||||
return (s + 1);
|
||||
if (s == filename)
|
||||
break; XXX
|
||||
*s = '\0';
|
||||
}
|
||||
return (filename);
|
||||
|
Loading…
x
Reference in New Issue
Block a user