diff options
| author | Jordan K. Hubbard <jkh@FreeBSD.org> | 2000-09-19 07:45:08 +0000 |
|---|---|---|
| committer | Jordan K. Hubbard <jkh@FreeBSD.org> | 2000-09-19 07:45:08 +0000 |
| commit | a6ee5211208d923b35deb0a81b8f21aebdfa17dd (patch) | |
| tree | a9212b51526ba2362c9fe36a3a69ef00db1e238c | |
| parent | 2276cee521e2c15d1f2bbecdf4ce3868e76b49b8 (diff) | |
Notes
| -rw-r--r-- | release/sysinstall/ftp.c | 10 | ||||
| -rw-r--r-- | usr.sbin/sysinstall/ftp.c | 10 |
2 files changed, 8 insertions, 12 deletions
diff --git a/release/sysinstall/ftp.c b/release/sysinstall/ftp.c index f83367e10eae..b9cb0dc2d3cc 100644 --- a/release/sysinstall/ftp.c +++ b/release/sysinstall/ftp.c @@ -162,17 +162,15 @@ try: * rel. If it succeeds we break out. If it fails, then we go back to * the base directory and try again. Lots of chdirs, but oh well. :) */ - fdir = 0; - while (ftp_dirs[fdir] != NULL) { - if (ftpChdir(OpenConn, ftp_dirs[fdir++]) != 0) + for (fdir = 0; ftp_dirs[fdir]; fdir++) { + if (ftpChdir(OpenConn, (char *)ftp_dirs[fdir]) != 0) continue; if (ftpChdir(OpenConn, rel) == 0) { ftpInitted = TRUE; return TRUE; } - ftpChdir(OpenConn, "/"); - if (dir && *dir != '\0') - ftpChdir(OpenConn, dir); + else /* reset to "root" dir for a fresh try */ + ftpChdir(OpenConn, "/"); } /* diff --git a/usr.sbin/sysinstall/ftp.c b/usr.sbin/sysinstall/ftp.c index f83367e10eae..b9cb0dc2d3cc 100644 --- a/usr.sbin/sysinstall/ftp.c +++ b/usr.sbin/sysinstall/ftp.c @@ -162,17 +162,15 @@ try: * rel. If it succeeds we break out. If it fails, then we go back to * the base directory and try again. Lots of chdirs, but oh well. :) */ - fdir = 0; - while (ftp_dirs[fdir] != NULL) { - if (ftpChdir(OpenConn, ftp_dirs[fdir++]) != 0) + for (fdir = 0; ftp_dirs[fdir]; fdir++) { + if (ftpChdir(OpenConn, (char *)ftp_dirs[fdir]) != 0) continue; if (ftpChdir(OpenConn, rel) == 0) { ftpInitted = TRUE; return TRUE; } - ftpChdir(OpenConn, "/"); - if (dir && *dir != '\0') - ftpChdir(OpenConn, dir); + else /* reset to "root" dir for a fresh try */ + ftpChdir(OpenConn, "/"); } /* |
