diff options
author | jkh <jkh@FreeBSD.org> | 2000-09-19 07:45:08 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 2000-09-19 07:45:08 +0000 |
commit | 07a1e70e3d1a3989a22806f2f2549f119e43b6d4 (patch) | |
tree | 1e475911d7f55f2cc447a102ead1c7e98edf427b /release/sysinstall | |
parent | 222e32bc4941211d514ad22676414f71c1360b50 (diff) | |
download | FreeBSD-src-07a1e70e3d1a3989a22806f2f2549f119e43b6d4.zip FreeBSD-src-07a1e70e3d1a3989a22806f2f2549f119e43b6d4.tar.gz |
Simplify the ftp directory search code a little and eliminate a warning.
Diffstat (limited to 'release/sysinstall')
-rw-r--r-- | release/sysinstall/ftp.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/release/sysinstall/ftp.c b/release/sysinstall/ftp.c index f83367e..b9cb0dc 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, "/"); } /* |