diff options
author | ache <ache@FreeBSD.org> | 1995-01-21 01:37:22 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1995-01-21 01:37:22 +0000 |
commit | bf096f839ffdfd4c0bcf321e659b609f87898f79 (patch) | |
tree | 18628daa43868cc747a912947f254803dc6f6ef2 /usr.bin | |
parent | 0edc03212c3f07948f41571217c0ce0b0ecdbc96 (diff) | |
download | FreeBSD-src-bf096f839ffdfd4c0bcf321e659b609f87898f79.zip FreeBSD-src-bf096f839ffdfd4c0bcf321e659b609f87898f79.tar.gz |
Not go to interactive mode, if login failed for URLs, just
exit(1). Dedicated to Jordan.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ncftp/main.c | 3 | ||||
-rw-r--r-- | usr.bin/ncftp/open.c | 12 |
2 files changed, 10 insertions, 5 deletions
diff --git a/usr.bin/ncftp/main.c b/usr.bin/ncftp/main.c index f7c1d75..8a59967 100644 --- a/usr.bin/ncftp/main.c +++ b/usr.bin/ncftp/main.c @@ -345,7 +345,8 @@ Examples:\n\ makeargv(); /* setpeer uses this to tell if it was called from the cmd-line. */ eventnumber = 0L; - (void) cmdOpen(margc, margv); + if (cmdOpen(margc, margv) != NOERR) + exit(1); } eventnumber = 1L; diff --git a/usr.bin/ncftp/open.c b/usr.bin/ncftp/open.c index fbbe794..4be044d 100644 --- a/usr.bin/ncftp/open.c +++ b/usr.bin/ncftp/open.c @@ -29,6 +29,7 @@ int anon_open = dANONOPEN; /* Anonymous logins by default? */ int connected = 0; /* TRUE if connected to server */ /* If TRUE, set binary each connection. */ +int www = 0; /* TRUE if use URL */ Hostname hostname; /* Name of current host */ RemoteSiteInfo gRmtInfo; #ifdef GATEWAY @@ -107,7 +108,7 @@ void InitOpenOptions(OpenOptions *openopt) int GetOpenOptions(int argc, char **argv, OpenOptions *openopt) { - int opt, www; + int opt; char *cp, *hostp, *cpath; /* First setup the openopt variables. */ @@ -467,6 +468,7 @@ int Open(OpenOptions *openopt) int siteInRC; char *user, *pass, *acct; int login_verbosity, oldv; + int result = CMDERR; macnum = 0; /* Reset macros. */ @@ -593,6 +595,7 @@ int Open(OpenOptions *openopt) */ (void) _cd(NULL); } + result = NOERR; break; /* we are connected, so break the redial loop. */ /* end if we are connected */ } else { @@ -606,7 +609,7 @@ nextdial: disconnect(0, NULL); continue; /* Try re-dialing. */ } - return (NOERR); + return (result); } /* Open */ @@ -615,6 +618,7 @@ nextdial: int cmdOpen(int argc, char **argv) { OpenOptions openopt; + int result = NOERR; /* If there is already a site open, close that one so we can * open a new one. @@ -631,9 +635,9 @@ int cmdOpen(int argc, char **argv) gRmtInfo.hasMDTM = 1; if ((GetOpenOptions(argc, argv, &openopt) == USAGE) || - (Open(&openopt) == USAGE)) + ((result = Open(&openopt)) == USAGE)) return USAGE; - return NOERR; + return (www ? result : NOERR); } /* cmdOpen */ /* eof open.c */ |