Fix checking of directory access for "/foo". The parent directory is

"/", not "".
This commit is contained in:
bde 1995-02-16 11:42:36 +00:00
parent e0acfb2a48
commit 5ab11f181a
2 changed files with 4 additions and 2 deletions

View File

@ -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) {

View File

@ -220,6 +220,8 @@ tail(filename)
break;
if (s[1])
return (s + 1);
if (s == filename)
break; XXX
*s = '\0';
}
return (filename);