summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.bin/ftp/ftp.c4
-rw-r--r--usr.bin/ftp/main.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/ftp/ftp.c b/usr.bin/ftp/ftp.c
index 1ea43b9..5ac4cf1 100644
--- a/usr.bin/ftp/ftp.c
+++ b/usr.bin/ftp/ftp.c
@@ -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) {
diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c
index 0edff5e..7f2165d 100644
--- a/usr.bin/ftp/main.c
+++ b/usr.bin/ftp/main.c
@@ -220,6 +220,8 @@ tail(filename)
break;
if (s[1])
return (s + 1);
+ if (s == filename)
+ break; XXX
*s = '\0';
}
return (filename);
OpenPOWER on IntegriCloud