summaryrefslogtreecommitdiffstats
path: root/usr.bin/ncftp
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/ncftp')
-rw-r--r--usr.bin/ncftp/cmds.c60
-rw-r--r--usr.bin/ncftp/ftp.c52
-rw-r--r--usr.bin/ncftp/ftprc.c28
-rw-r--r--usr.bin/ncftp/getpass.c2
-rw-r--r--usr.bin/ncftp/main.c34
-rw-r--r--usr.bin/ncftp/open.c42
-rw-r--r--usr.bin/ncftp/patchlevel.h26
-rw-r--r--usr.bin/ncftp/set.c6
-rw-r--r--usr.bin/ncftp/sys.h4
-rw-r--r--usr.bin/ncftp/tips.c2
-rw-r--r--usr.bin/ncftp/util.c12
11 files changed, 134 insertions, 134 deletions
diff --git a/usr.bin/ncftp/cmds.c b/usr.bin/ncftp/cmds.c
index 564c799..2b6972b 100644
--- a/usr.bin/ncftp/cmds.c
+++ b/usr.bin/ncftp/cmds.c
@@ -147,9 +147,9 @@ long GetDateSizeFromLSLine(char *fName, unsigned long *mod_time)
if (code >= 400 && code < 500)
goto aa;
- /* See if this line looks like a unix-style ls line.
+ /* See if this line looks like a unix-style ls line.
* If so, we can grab the date and size from it.
- */
+ */
if (strpbrk(lsline, "-dlsbcp") == lsline) {
/* See if it looks like a typical '-rwxrwxrwx' line. */
cp = lsline + 1;
@@ -161,7 +161,7 @@ long GetDateSizeFromLSLine(char *fName, unsigned long *mod_time)
cp += 2;
if (*cp != 'r' && *cp != '-')
goto aa;
-
+
/* skip mode, links, owner (and possibly group) */
for (n = 0; n < 4; n++) {
np = cp;
@@ -173,7 +173,7 @@ long GetDateSizeFromLSLine(char *fName, unsigned long *mod_time)
if (!isdigit(*cp))
cp = np; /* back up (no group) */
(void) sscanf(cp, "%ld%n", &size, &n);
-
+
*mod_time = UnLSDate(cp + n + 1);
if (size < 100) {
@@ -185,7 +185,7 @@ long GetDateSizeFromLSLine(char *fName, unsigned long *mod_time)
/* Try the file. */
}
}
- }
+ }
aa:
--depth;
return (size);
@@ -244,7 +244,7 @@ long GetDateAndSize(char *fName, unsigned long *mod_time)
* we could, since some maverick ftp server may be using a non-standard
* ls command, and we could parse it wrong.
*/
-
+
if (!have_mdtm)
mdtm = ls_mdtm;
if (!have_size)
@@ -276,7 +276,7 @@ int _settype(char *typename)
int comret, c;
string cmd;
char *cp;
-
+
c = isupper(*typename) ? tolower(*typename) : (*typename);
if ((cp = index(typeabbrs, c)) != NULL)
p = &types[(int) (cp - typeabbrs)];
@@ -286,7 +286,7 @@ int _settype(char *typename)
}
if (c == 't')
(void) strcpy(cmd, "TYPE L 8");
- else
+ else
(void) sprintf(cmd, "TYPE %s", p->t_mode);
comret = command(cmd);
if (comret == COMPLETE) {
@@ -365,7 +365,7 @@ usage:
}
if (argc < 3)
argv = re_makeargv("(remote-file) ", &argc);
- if (argc < 3)
+ if (argc < 3)
goto usage;
cmd = (argv[0][0] == 'a') ? "APPE" : "STOR";
(void) sendrequest(cmd, argv[1], argv[2]);
@@ -396,7 +396,7 @@ int mput(int argc, char **argv)
for (i = 1; i < argc; i++) {
register char **cpp, **gargs;
char *icopy;
-
+
/* Make a copy of the argument, because glob() will just copy
* the pointer you give it to the glob-arg vector, and blkfree()
* will want to free each element of the glob-arg vector
@@ -536,7 +536,7 @@ int get(int argc, char **argv)
* Note that ZCAT is defined to be GZCAT if you defined
* GZCAT.
*/
-
+
if (try_zcat) {
(void) _settype("b");
(void) sprintf(local_file, "|%s ", ZCAT);
@@ -554,7 +554,7 @@ int get(int argc, char **argv)
} else {
if (argc < 3)
argv = re_makeargv("(local-file) ", &argc);
- if (argc < 3)
+ if (argc < 3)
return USAGE;
(void) LocalDotPath(argv[2]);
}
@@ -677,7 +677,7 @@ xx:
return (NULL);
}
}
- if (FGets(str, ftemp) == NULL)
+ if (FGets(str, ftemp) == NULL)
goto xx;
if ((cp = index(str, '\n')) != NULL)
*cp = '\0';
@@ -770,7 +770,7 @@ int cd(int argc, char **argv)
int implicit_cd(char *dir)
{
int i, j = 0;
-
+
if (connected) {
i = verbose;
/* Special verbosity level that ignores errors and prints other stuff,
@@ -842,7 +842,7 @@ int lcd(int argc, char **argv)
return CMDERR;
}
(void) get_cwd(lcwd, (int) sizeof(lcwd));
- if (NOT_VQUIET)
+ if (NOT_VQUIET)
(void) printf("Local directory now %s\n", lcwd);
return NOERR;
} /* lcd */
@@ -973,7 +973,7 @@ int ls(int argc, char **argv)
(void) strncpy(local, (pagemode ? pager : "-"), sizeof(local));
remote[0] = lsflags[0] = 0;
-
+
/* Possible scenarios:
* 1. ls
* 2. ls -flags
@@ -989,7 +989,7 @@ int ls(int argc, char **argv)
for (i=1; i<argc; i++) {
switch (argv[i][0]) {
- case '-':
+ case '-':
/*
* If you give more than one set of flags, concat the each
* additional set to the first one (without the dash).
@@ -1005,7 +1005,7 @@ int ls(int argc, char **argv)
(void) Strncpy(local, argv[i] + 1);
LocalDotPath(local);
break;
- default:
+ default:
cp = argv[i];
/*
* In case you want to get a remote file called '--README--'
@@ -1019,11 +1019,11 @@ int ls(int argc, char **argv)
} else {
(void) Strncpy(remote, cp);
}
- } /* end switch */
+ } /* end switch */
} /* end loop */
/*
- * If we are given an ls with some flags, make sure we use
+ * If we are given an ls with some flags, make sure we use
* columnized output (-C) unless one column output (-1) is
* specified.
*/
@@ -1534,7 +1534,7 @@ int domacro(int argc, char **argv)
}
if (argc == 0) return (NOERR); /* called from macdef(), above. */
argv = re_makeargv("(macro to run) ", &argc);
- }
+ }
if (argc < 2) {
return USAGE;
}
@@ -1718,7 +1718,7 @@ int lookup(int argc, char **argv)
}
if (host == NULL) {
if (NOT_VQUIET) {
- /* gethostxxx error */
+ /* gethostxxx error */
if (h_errno == HOST_NOT_FOUND) {
(void) printf("%s: lookup error (%d).\n",
argv[i], h_errno);
@@ -1727,7 +1727,7 @@ int lookup(int argc, char **argv)
(void) printf("%s \"%s\"\n",
(by_name==0 ? "unknown address" : "unknown host"),
argv[i]);
- result =
+ result =
h_errno != 0 ? h_errno :
-1;
}
@@ -1745,7 +1745,7 @@ int lookup(int argc, char **argv)
(void) printf("%-32s ", *host->h_name ? host->h_name : "???");
if (*host->h_addr_list) {
unsigned long horder;
-
+
horder = ntohl (*(unsigned long *) *(char **)host->h_addr_list);
(void) printf ("%lu.%lu.%lu.%lu\n",
(horder >> 24),
@@ -1972,13 +1972,13 @@ int show_version(int argc, char **argv)
#ifdef TERMH
DStrs[nDStrs++] = "TERMH";
#endif
-#ifdef NO_UNISTDH
+#ifdef NO_UNISTDH
DStrs[nDStrs++] = "NO_UNISTDH";
#endif
#ifdef NO_STDLIBH
DStrs[nDStrs++] = "NO_STDLIBH";
#endif
-#ifdef SYSLOG
+#ifdef SYSLOG
DStrs[nDStrs++] = "SYSLOG";
#endif
#ifdef BAD_INETADDR
@@ -2002,7 +2002,7 @@ int show_version(int argc, char **argv)
#ifdef READLINE
DStrs[nDStrs++] = "READLINE";
#endif
-#ifdef GETLINE
+#ifdef GETLINE
DStrs[nDStrs++] = "GETLINE";
#endif
#ifdef _POSIX_SOURCE
@@ -2023,13 +2023,13 @@ int show_version(int argc, char **argv)
#ifdef TRY_NOREPLY
DStrs[nDStrs++] = "TRY_NOREPLY";
#endif
-#ifdef NO_UTIMEH
+#ifdef NO_UTIMEH
DStrs[nDStrs++] = "NO_UTIMEH";
#endif
#ifdef DB_ERRS
DStrs[nDStrs++] = "DB_ERRS";
#endif
-#ifdef NO_VARARGS
+#ifdef NO_VARARGS
DStrs[nDStrs++] = "NO_VARARGS";
#endif
#ifdef NO_STDARGH
@@ -2107,7 +2107,7 @@ int show_version(int argc, char **argv)
void PurgeLineBuffer(void)
{
register struct lslist *a, *b;
-
+
for (a = lshead; a != NULL; ) {
b = a->next;
if (a->string)
diff --git a/usr.bin/ncftp/ftp.c b/usr.bin/ncftp/ftp.c
index c90aafe..2fdeffb 100644
--- a/usr.bin/ncftp/ftp.c
+++ b/usr.bin/ncftp/ftp.c
@@ -74,7 +74,7 @@ int cur_progress_meter;
int sendport = -1; /* use PORT cmd for each data connection */
int using_pasv;
int code; /* return/reply code for ftp command */
-string indataline;
+string indataline;
int cpend; /* flag: if != 0, then pending server reply */
char *xferbuf; /* buffer for local and remote I/O */
size_t xferbufsize; /* size in bytes, of the transfer buffer. */
@@ -341,7 +341,7 @@ int Login(char *userNamePtr, char *passWordPtr, char *accountPtr, int doInit)
(void) printf("Login failed.\n");
goto done;
}
-
+
/* If you specified an account, and the remote-host didn't request it
* (maybe it's optional), we will send the account information.
*/
@@ -474,7 +474,7 @@ int command_noreply(char *cmd)
int quiet_command(char *cmd)
{
register int oldverbose, result;
-
+
oldverbose = verbose;
verbose = debug ? V_VERBOSE : V_QUIET;
result = command(cmd);
@@ -488,7 +488,7 @@ int quiet_command(char *cmd)
int verbose_command(char *cmd)
{
register int oldverbose, result;
-
+
oldverbose = verbose;
verbose = V_VERBOSE;
result = command(cmd);
@@ -566,7 +566,7 @@ int getreply(int expecteof)
if (n == 0)
n = c;
} /* end for(;;) #2 */
-
+
*cp = '\0';
dbprintf("rsp: %s", reply_string);
@@ -579,7 +579,7 @@ int getreply(int expecteof)
dp = reply_string;
goto stripCode;
}
- break;
+ break;
case V_IMPLICITCD:
case V_TERSE:
dp = NULL;
@@ -610,14 +610,14 @@ int getreply(int expecteof)
dp = reply_string;
}
}
- if (dp == NULL) break;
+ if (dp == NULL) break;
stripCode:
/* Try to strip out the code numbers, etc. */
if (isdigit(*dp++) && isdigit(*dp++) && isdigit(*dp++)) {
if (*dp == ' ' || *dp == '-') {
dp++;
if (*dp == ' ') dp++;
- } else dp = reply_string;
+ } else dp = reply_string;
} else {
int spaces;
dp = reply_string;
@@ -626,7 +626,7 @@ stripCode:
break;
if (spaces == 4)
dp += spaces;
- }
+ }
goto printLine;
case V_VERBOSE:
dp = reply_string;
@@ -706,7 +706,7 @@ int start_progress(int sending, char *local)
(void) printf("%s: ", local);
goto zz;
case pr_philbar:
- (void) printf("%s%s file: %s %s\n",
+ (void) printf("%s%s file: %s %s\n",
tcap_boldface,
sending ? "Sending" : "Receiving",
local,
@@ -797,7 +797,7 @@ int progress_report(int finish_up)
(void) fflush(stdout);
last_dot += (file_size / 10) + 1;
dots++;
- }
+ }
} /* end switch */
now_sec = stop.tv_sec;
} /* end if we updated */
@@ -1100,7 +1100,7 @@ int sendrequest(char *cmd, char *local, char *remote)
if (d <= 0) {
if (d == 0 && !creating)
(void) fprintf(stderr, "netout: write returned 0?\n");
- else if (errno != EPIPE)
+ else if (errno != EPIPE)
PERROR("sendrequest", "netout");
bytes = -1;
}
@@ -1161,7 +1161,7 @@ void abortrecv SIG_PARAMS
{
activemcmd = 0;
abrtflag = 0;
- (void) fprintf(stderr,
+ (void) fprintf(stderr,
#ifdef TRY_ABOR
"(abort)\n");
#else
@@ -1204,7 +1204,7 @@ void GetLSRemoteDir(char *remote, char *remote_dir)
int AdjustLocalFileName(char *local)
{
char *dir;
-
+
/* See if the file exists, and if we can overwrite it. */
if ((access(local, 0) == 0) && (access(local, 2) < 0))
goto noaccess;
@@ -1249,7 +1249,7 @@ noaccess: PERROR("AdjustLocalFileName", local);
}
return (NOERR);
} /* AdjustLocalFileName */
-
+
int SetToAsciiForLS(int is_retr, int currenttype)
@@ -1280,7 +1280,7 @@ int IssueCommand(char *ftpcmd, char *remote)
(void) sprintf(str, "%s %s", ftpcmd, remote);
else
(void) Strncpy(str, ftpcmd);
-
+
#ifdef TRY_NOREPLY
if (command_noreply(str) != PRELIM)
#else
@@ -1442,7 +1442,7 @@ lineMode)
if (!buffer_only)
(void) putc(c, fout);
bytes++;
-
+
/* Print progress indicator. */
if (do2 && bytes > next_report)
do2 = progress_report(0);
@@ -1460,7 +1460,7 @@ lineMode)
AddRedirLine(str2);
nchars = 0;
}
-
+
} /* while ((c = getc(din)) != EOF) */
break2:
if (ferror(din)) {
@@ -1575,13 +1575,13 @@ int recvrequest(char *cmd, char *local, char *remote, char *mode)
oldtype = SetToAsciiForLS(is_retr, curtype);
- /* Issue the NLST command but don't wait for the reply. Some FTP
- * servers make the data connection before issuing the
+ /* Issue the NLST command but don't wait for the reply. Some FTP
+ * servers make the data connection before issuing the
* "150 Opening ASCII mode data connection for /bin/ls" reply.
*/
if (IssueCommand(cmd, remote))
goto xx;
-
+
if ((fout = OpenOutputFile(filetype, local, mode, &oldintp)) == NULL)
goto xx;
@@ -1621,7 +1621,7 @@ int recvrequest(char *cmd, char *local, char *remote, char *mode)
/* Don't interrupt us now, since we finished successfully. */
(void) Signal(SIGPIPE, SIG_IGN);
(void) Signal(SIGINT, SIG_IGN);
- }
+ }
CloseData();
(void) getreply(0);
@@ -1635,7 +1635,7 @@ Abort:
(void) Signal(SIGINT, SIG_IGN);
if (!cpend || !cout) goto xx;
(void) fprintf(cout,"%c%c",IAC,IP);
- (void) fflush(cout);
+ (void) fflush(cout);
msg = IAC;
/* send IAC in urgent mode instead of DM because UNIX places oob mark */
/* after urgent byte rather than before as now is protocol */
@@ -1702,7 +1702,7 @@ int initconn(void)
char *cp;
int a1, a2, a3, a4, p1, p2;
unsigned char n[6];
-
+
oldintr = Signal(SIGINT, SIG_IGN);
if (using_pasv) {
@@ -1793,7 +1793,7 @@ TryPort:
noport:
data_addr = myctladdr;
if (sendport)
- data_addr.sin_port = 0; /* let system pick one */
+ data_addr.sin_port = 0; /* let system pick one */
if (data != -1)
(void) close (data);
data = socket(AF_INET, SOCK_STREAM, 0);
@@ -1853,7 +1853,7 @@ noport:
goto bad;
}
-#ifdef SOCKS
+#ifdef SOCKS
if (Rlisten(data, 1) < 0)
#else
if (listen(data, 1) < 0)
diff --git a/usr.bin/ncftp/ftprc.c b/usr.bin/ncftp/ftprc.c
index c048852..3fde1fd 100644
--- a/usr.bin/ncftp/ftprc.c
+++ b/usr.bin/ncftp/ftprc.c
@@ -59,7 +59,7 @@ int thrash_rc(void)
(void) sprintf(rcname, "%s%s", cwd, rc);
if (stat(rcname, &st) == 0)
goto foundrc;
-
+
(void) sprintf(rcname, "%s.%s", cwd, rc);
if (stat(rcname, &st) == 0)
goto foundrc;
@@ -76,8 +76,8 @@ int thrash_rc(void)
}
return (0); /* it's OK not to have an rc. */
-
-foundrc:
+
+foundrc:
if ((st.st_mode & 077) != 0) /* rc must be unreadable by others. */
(void) chmod(rcname, 0600);
@@ -85,7 +85,7 @@ foundrc:
PERROR("thrash_rc", rcname);
return -1;
}
-
+
parsing_rc = 1;
while ((cp = FGets(str, fp)) != 0) {
while (isspace(*cp)) ++cp; /* skip leading space. */
@@ -93,7 +93,7 @@ foundrc:
if ((strncmp("set", ++cp, (size_t)3) == 0) || (strncmp("unset", cp, (size_t)5) == 0)) {
(void) strcpy(line, cp);
makeargv();
- (void) set(margc, margv);
+ (void) set(margc, margv);
/* setting or unsetting a variable. */
} /* else a comment. */
} else {
@@ -143,7 +143,7 @@ void AddNewSitePtr(char *word)
static int RecentCmp(recentsite *a, recentsite *b)
{
int i = 1;
-
+
if (a->lastcall > b->lastcall)
i = -1;
else if (a->lastcall == b->lastcall)
@@ -161,7 +161,7 @@ static siteptr FindNetrcSite(char *host, int exact)
(void) Strncpy(host2, host);
StrLCase(host2);
-
+
/* see if 'host' is in our list of favorite sites (in NETRC). */
for (s = firstsite; s != NULL; s2=s->next, s=s2) {
(void) Strncpy(str, s->name);
@@ -170,7 +170,7 @@ static siteptr FindNetrcSite(char *host, int exact)
if (strcmp(str, host2) == 0)
return s;
} else {
- if (strstr(str, host2) != NULL)
+ if (strstr(str, host2) != NULL)
return s;
}
}
@@ -293,14 +293,14 @@ void AddRecentSite(char *host, char *lastdir)
{
char *nhost, *ndir;
recentsite *r;
-
+
if (keep_recent) {
nhost = NewString(host);
/* Use '/' to denote that the current directory wasn't known,
* because we won't try to cd to the root directory.
*/
ndir = NewString(*lastdir ? lastdir : "/");
-
+
/* Don't bother if we don't have the memory, or if it is already
* in our NETRC.
*/
@@ -317,7 +317,7 @@ void AddRecentSite(char *host, char *lastdir)
r = &recents[nRecents];
nRecents++;
}
- r->name = nhost;
+ r->name = nhost;
r->dir = ndir;
(void) time(&r->lastcall);
SortRecentList();
@@ -337,7 +337,7 @@ void UpdateRecentSitesList(char *host, char *lastdir)
recentsite *r;
char *ndir;
- if (keep_recent) {
+ if (keep_recent) {
r = FindRecentSite(host, 1);
if (r == NULL)
AddRecentSite(host, lastdir);
@@ -459,7 +459,7 @@ void GetFullSiteName(char *host, char *lastdir)
* "2. unlinfo.unl.edu" and IP numbers "128.93.2.1" or even numbers
* in the site name like "simtel20.army.mil."
*/
-
+
for (isAllDigits = 1, cp = host; *cp != 0; cp++) {
if (!isdigit(*cp)) {
isAllDigits = 0;
@@ -493,7 +493,7 @@ void GetFullSiteName(char *host, char *lastdir)
x -= nRecents;
if (x < nSites) {
for (i = 0, s = firstsite; i < x; s2=s->next, s=s2)
- ++i;
+ ++i;
nhost = s->name;
}
}
diff --git a/usr.bin/ncftp/getpass.c b/usr.bin/ncftp/getpass.c
index a039e7a..01e203d 100644
--- a/usr.bin/ncftp/getpass.c
+++ b/usr.bin/ncftp/getpass.c
@@ -54,7 +54,7 @@ void Echo(FILE *fp, int on)
#endif
static int state = 0;
int fd = fileno(fp);
-
+
if (!isatty(fd))
return;
diff --git a/usr.bin/ncftp/main.c b/usr.bin/ncftp/main.c
index 68d9da7..b0a11c4 100644
--- a/usr.bin/ncftp/main.c
+++ b/usr.bin/ncftp/main.c
@@ -141,7 +141,7 @@ void main(int argc, char **argv)
if ((cp = rindex(argv[0], '/'))) cp++;
else cp = argv[0];
(void) Strncpy(progname, cp);
-
+
sptr = getservbyname("ftp", "tcp");
if (sptr == 0) fatal("ftp/tcp: unknown service");
serv = *sptr;
@@ -185,7 +185,7 @@ Re-compile, this time with -DZCAT=\\\"/path/to/zcat\\\".\n");
#ifdef SOCKS
SOCKSinit("ncftp");
#endif
-
+
/* Setup our pager variable, before we run through the rc,
which may change it. */
set_pager(getenv("PAGER"), 0);
@@ -255,7 +255,7 @@ Re-compile, this time with -DZCAT=\\\"/path/to/zcat\\\".\n");
case 'D':
debug = atoi(Optarg);
break;
-
+
case 'V':
set_verbose(Optarg, 0);
break;
@@ -323,12 +323,12 @@ Examples:\n\
ReadRecentSitesFile();
(void) fix_options(); /* adjust "options" according to "debug" */
-
+
fromatty = doing_script = isatty(0);
toatty = isatty(1);
(void) UserLoggedIn(); /* Init parent-death detection. */
cpend = 0; /* no pending replies */
-
+
if (*logfname)
logf = fopen (logfname, "a");
@@ -363,7 +363,7 @@ For testing purposes only. Do not re-distribute or subject to novice users."
#endif
#ifndef CURSES
- (void) printf("%sNcFTP %s by Mike Gleason, NCEMRSoft.%s%s%s%s\n",
+ (void) printf("%sNcFTP %s by Mike Gleason, NCEMRSoft.%s%s%s%s\n",
tcap_boldface,
FTP_VERSION,
tcap_normal,
@@ -373,7 +373,7 @@ For testing purposes only. Do not re-distribute or subject to novice users."
);
#else
char vis[256];
- (void) sprintf(vis, "%sNcFTP %s by Mike Gleason, NCEMRSoft.%s%s%s%s\n",
+ (void) sprintf(vis, "%sNcFTP %s by Mike Gleason, NCEMRSoft.%s%s%s%s\n",
tcap_boldface,
FTP_VERSION,
tcap_normal,
@@ -419,7 +419,7 @@ int getuserinfo(void)
struct passwd *pw;
string str;
extern char *home; /* for glob.c */
-
+
home = uinfo.homedir; /* for glob.c */
pw = NULL;
#ifdef USE_GETPWUID
@@ -512,7 +512,7 @@ int init_arrays(void)
goto barf;
if ((reply_string = (char *) malloc((size_t)(RECEIVEDLINELEN))) == NULL)
goto barf;
-
+
*macbuf = '\0';
init_transfer_buffer();
return (0);
@@ -530,7 +530,7 @@ void init_transfer_buffer(void)
{
extern char *xferbuf;
extern size_t xferbufsize;
-
+
/* Make sure we use a multiple of BUFSIZ for efficiency. */
xferbufsize = (MAX_XFER_BUFSIZE / BUFSIZ) * BUFSIZ;
while (1) {
@@ -539,7 +539,7 @@ void init_transfer_buffer(void)
break;
xferbufsize >>= 2;
}
-
+
if (xferbuf != NULL) return;
fatal("out of memory for transfer buffer.");
} /* init_transfer_buffer */
@@ -550,7 +550,7 @@ void init_transfer_buffer(void)
void init_prompt(void)
{
register char *cp;
-
+
percent_flags = at_flags = 0;
for (cp = prompt; *cp; cp++) {
if (*cp == '%') percent_flags = 1;
@@ -736,9 +736,9 @@ char *strprompt(void)
*q++ = *p;
}
*q = '\0';
- } else
+ } else
(void) strcpy(prompt2, prompt);
-
+
#ifndef NO_STRFTIME
if (percent_flags) {
/* only strftime if the user requested it (with a %something),
@@ -925,7 +925,7 @@ help(int argc, char **argv)
Commands may be abbreviated. 'help showall' shows aliases, invisible and\n\
unsupported commands. 'help <command>' gives a brief description of <command>.\n\n");
- for (c = cmdtab, nCmds2Print=0; c->c_name != NULL; c++)
+ for (c = cmdtab, nCmds2Print=0; c->c_name != NULL; c++)
if (!c->c_hidden || showall)
nCmds2Print++;
@@ -1015,7 +1015,7 @@ void trim_log(void)
}
if (*str != '\t') break;
}
-
+
/* copy the remaining lines in "old" to "new" */
(void) Strncpy(tmplogname, logfname);
tmplogname[strlen(tmplogname) - 1] = 'T';
@@ -1100,7 +1100,7 @@ int termcap_get(char **dest, char *attr)
} /* termcap_get */
-
+
void termcap_init(void)
{
char *term;
diff --git a/usr.bin/ncftp/open.c b/usr.bin/ncftp/open.c
index 23b017a..5836da6 100644
--- a/usr.bin/ncftp/open.c
+++ b/usr.bin/ncftp/open.c
@@ -49,7 +49,7 @@ extern string anon_password;
* that can be set from the command line), this routine makes sure all
* the variables have valid values by setting them to their defaults.
*/
-
+
void InitOpenOptions(OpenOptions *openopt)
{
/* How do you want to open a site if neither -a or -u are given?
@@ -70,7 +70,7 @@ void InitOpenOptions(OpenOptions *openopt)
* this is changed.
*/
openopt->max_dials = 1;
-
+
/* You don't want to cat the file to stdout by default. */
openopt->ftpcat = NO_FTPCAT;
@@ -94,7 +94,7 @@ void InitOpenOptions(OpenOptions *openopt)
/* Set the hostname to a null string, since there is no default host. */
openopt->hostname[0] = 0;
-
+
/* Set the opening directory path to a null string. */
openopt->cdpath[0] = 0;
} /* InitOpenOptions */
@@ -117,22 +117,22 @@ int GetOpenOptions(int argc, char **argv, OpenOptions *openopt)
/* Tell Getopt() that we want to start over with a new command. */
Getopt_Reset();
while ((opt = Getopt(argc, argv, "aiup:rd:g:cm")) >= 0) {
- switch (opt) {
+ switch (opt) {
case 'a':
/* User wants to open anonymously. */
openopt->openmode = openExplicitAnon;
break;
-
+
case 'u':
/* User wants to open with a login and password. */
openopt->openmode = openExplicitUser;
break;
-
+
case 'i':
/* User wants to ignore the entry in the netrc. */
openopt->ignore_rc = 1;
break;
-
+
case 'p':
/* User supplied a port number different from the default
* ftp port.
@@ -146,14 +146,14 @@ int GetOpenOptions(int argc, char **argv, OpenOptions *openopt)
/* Must ensure that the port is in the correct byte order! */
openopt->port = htons(openopt->port);
break;
-
+
case 'd':
/* User supplied a delay (in seconds) that differs from
* the default.
*/
openopt->redial_delay = atoi(Optarg);
break;
-
+
case 'g':
/* User supplied an upper-bound on the number of redials
* to try.
@@ -201,7 +201,7 @@ Try 'ncftp -c wuarchive.wustl.edu:/README > file.'\n");
goto usage;
}
/* break; */
-
+
default:
usage:
return USAGE;
@@ -260,7 +260,7 @@ Try 'ncftp -c wuarchive.wustl.edu:/README > file.'\n");
(void) Strncat(openopt->colonmodepath, cpath);
dbprintf("Colon-Mode Path = '%s'\n", openopt->colonmodepath);
}
- }
+ }
(void) Strncpy(openopt->hostname, hostp);
dbprintf("Host = '%s'\n", hostp);
}
@@ -321,7 +321,7 @@ int HookupToRemote(OpenOptions *openopt)
} else
#endif
hErr = hookup(openopt->hostname, openopt->port);
-
+
return hErr;
} /* HookupToRemote */
@@ -340,7 +340,7 @@ void CheckRemoteSystemType(int force_binary)
tmpverbose = verbose;
verbose = V_QUIET;
if (command("SYST") == COMPLETE) {
- if (tmpverbose == V_VERBOSE) {
+ if (tmpverbose == V_VERBOSE) {
/* Find the system type embedded in the reply_string,
* and separate it from the rest of the junk.
*/
@@ -375,7 +375,7 @@ void CheckRemoteSystemType(int force_binary)
}
/* Print a warning for that (extremely) rare Tenex machine. */
- if (tmpverbose >= V_ERRS &&
+ if (tmpverbose >= V_ERRS &&
!strncmp(reply_string, "215 TOPS20", (size_t) 10)) {
(void) _settype("tenex");
(void) printf("Using tenex mode to transfer files.\n");
@@ -436,7 +436,7 @@ void ColonMode(OpenOptions *openopt)
/* Turn on messaging if we aren't catting. */
if (openopt->ftpcat == 0)
verbose = tmpverbose;
-
+
/* get() also handles 'more'. */
if (openopt->ftpcat)
cmdstatus = get(margc, margv);
@@ -466,7 +466,7 @@ int Open(OpenOptions *openopt)
int dials;
char *ruser, *rpass, *racct;
int siteInRC;
- char *user, *pass, *acct;
+ char *user, *pass, *acct;
int login_verbosity, oldv;
int result = CMDERR;
@@ -506,7 +506,7 @@ int Open(OpenOptions *openopt)
pass = NULL;
}
acct = NULL;
-
+
if (siteInRC && !openopt->ignore_rc) {
acct = racct;
if (ruser != NULL) {
@@ -519,7 +519,7 @@ int Open(OpenOptions *openopt)
user = ruser;
pass = rpass;
}
- }
+ }
}
for (
@@ -533,7 +533,7 @@ int Open(OpenOptions *openopt)
(void) fprintf(stderr, "Retry Number: %d\n", dials + 1);
}
- if ((hErr = HookupToRemote(openopt)) == -2)
+ if ((hErr = HookupToRemote(openopt)) == -2)
/* Recoverable, so we can try re-dialing. */
continue;
else if (hErr == NOERR) {
@@ -541,7 +541,7 @@ int Open(OpenOptions *openopt)
connected = 1;
oldv = verbose; verbose = login_verbosity;
-
+
#ifdef GATEWAY
if (*gateway) {
if ((Login(
@@ -588,7 +588,7 @@ int Open(OpenOptions *openopt)
*/
(void) _cd(openopt->cdpath);
} else {
- /* Freshen 'cwd' variable for the prompt.
+ /* Freshen 'cwd' variable for the prompt.
* We have to do atleast one 'cd' so our variable
* cwd (which is saved by _cd()) is set to something
* valid.
diff --git a/usr.bin/ncftp/patchlevel.h b/usr.bin/ncftp/patchlevel.h
index 377ae9c..d655b14 100644
--- a/usr.bin/ncftp/patchlevel.h
+++ b/usr.bin/ncftp/patchlevel.h
@@ -52,7 +52,7 @@ v1.7.8 - June 30, 1994. No longer defining TERMH for linux.
v1.7.7 - June 21, 1994. Deleted a space in front of an " #endif".
No functionality change whatsoever...
-v1.7.6 - June 18, 1994. Added commands and code to support the
+v1.7.6 - June 18, 1994. Added commands and code to support the
PASV command for passive negotiation of the data connection from
the host server to the client. This facilitates operation of the
client software from within a firewall. (J. B. Harrell)
@@ -79,39 +79,39 @@ v1.7.1 - March 27, 1994. Defining HAS_DOMAINNAME for NeXT. Term hack can
first now. Smarter about determining abbreviations from local hostnames.
Fixed bug where progress meter would go beserk after trying to get
a non-existant file.
-
+
v1.7.0 - March 14, 1994. More verbose when logging to the system log,
and making sure that syslog() itself is called with a total of 5
or less parameters. Official patch posted which incorporates all
the fixes to 1.6.0 (i.e. 1.6.1, 1.6.2, ... 1.6.9).
-
+
v1.6.9 - March 11, 1994. Added DOMAIN_NAME and Solaris CPP symbols.
Better handling of getting the domain name, specifically with SunOS.
BSDi support added.
-
+
v1.6.8 - March 4, 1994. Ensuring that tmp files are not public.
Trying harder to get the real hostname, and fixed problem with
disappearing progress meters (both due to T. Lindgren).
-
+
v1.6.7 - February 20, 1994. Using getpwnam() instead of getpwuid().
Supporting WWW paths (i.e. ftp://host.name/path/name).
-
+
v1.6.6 - February 15, 1994. Prevented scenario of fclosing a NULL FILE *.
Edited term ftp's hookup() a little. More defs for linux in sys.h.
Not updating a recent entry unless you were fully logged in.
-
+
v1.6.5 - January 6, 1994. Fixed error with an #ifndef/#endif block having
whitespace before the #. No longer confirming "ls >file" actions.
Changed echo() to Echo(). AIX 3 uses TERMIOS.
-
+
v1.6.4 - December 30, 1993. Fixed rare problem with GetDateAndTime.
- confirm() will return true if you're running the init macro.
-
+ confirm() will return true if you're running the init macro.
+
v1.6.3 - December 28, 1993. Added a new diagnostic command, memchk,
to print stats from a special malloc library if you used one.
Using SIZE and MDTM when the remote site supports it. Using a new
set of routines for term (again).
-
+
v1.6.2 - December 10, 1993.
Term hack no longer depends on the PASV command (!). The BROKEN_MEMCPY
problem worked-around. More wary of symbolic-link recursion.
@@ -119,11 +119,11 @@ v1.6.2 - December 10, 1993.
buffer. Debug mode won't print your password. Progress meters
no longer goof up when the file is huge. Added time-remaining to the
Philbar.
-
+
v1.6.1 - November 5, 1993.
Checking if we have permission to write over a file to fetch.
A few very minor changes. BSD no longer trying to use strchr :-)
-
+
v1.6.0 - October 31, 1993.
Added "term" support for Linux users. Better SCO Xenix support. Added
-DLINGER, if you have a connection requiring it (so 'puts' to the remote
diff --git a/usr.bin/ncftp/set.c b/usr.bin/ncftp/set.c
index b071df2..9ce8786 100644
--- a/usr.bin/ncftp/set.c
+++ b/usr.bin/ncftp/set.c
@@ -100,7 +100,7 @@ void set_verbose(char *new, int unset)
else if (unset || !new) verbose = V_ERRS;
else {
if (isalpha(*new)) {
- c = islower(*new) ? toupper(*new) : *new;
+ c = islower(*new) ? toupper(*new) : *new;
for (i=0; i<(int)(sizeof(short_verbose_msgs)/sizeof(char *)); i++) {
if (short_verbose_msgs[i][0] == c)
verbose = i - 1;
@@ -113,7 +113,7 @@ void set_verbose(char *new, int unset)
}
}
(void) Strncpy(vstr, short_verbose_msgs[verbose+1]);
- if (!parsing_rc && NOT_VQUIET)
+ if (!parsing_rc && NOT_VQUIET)
(void) fputs(verbose_msgs[verbose+1], stdout);
} /* set_verbose */
@@ -324,7 +324,7 @@ int set(int argc, char **argv)
if (v != NULL) {
if (v->conn_required && !connected)
(void) fprintf(stderr, "%s: must be connected.\n", var);
- else if (v->type < 0)
+ else if (v->type < 0)
(void) fprintf(stderr, "%s: read-only variable.\n", var);
else if (v->proc != (setvarproc) 0) {
(*v->proc)(val, unset); /* a custom set proc. */
diff --git a/usr.bin/ncftp/sys.h b/usr.bin/ncftp/sys.h
index b42571a..d009caa 100644
--- a/usr.bin/ncftp/sys.h
+++ b/usr.bin/ncftp/sys.h
@@ -257,7 +257,7 @@ extern int errno;
# define Select(a,b,c,d,e) select((a), (int *)(b), (c), (d), (e))
#endif
-#ifdef HPUX
+#ifdef HPUX
# define System "HP-UX"
# ifndef _HPUX_SOURCE
# define _HPUX_SOURCE 1
@@ -596,7 +596,7 @@ extern void bcopy(char *, char *, size_t);
extern void bzero(char *, size_t);
#endif
-#ifdef SOCKS
+#ifdef SOCKS
extern int Raccept(int, struct sockaddr *, int *);
extern int Rbind(int, struct sockaddr *, int, unsigned long);
extern int Rconnect(int, struct sockaddr *, int);
diff --git a/usr.bin/ncftp/tips.c b/usr.bin/ncftp/tips.c
index 30330b6..bdd0cd5 100644
--- a/usr.bin/ncftp/tips.c
+++ b/usr.bin/ncftp/tips.c
@@ -47,7 +47,7 @@ static char *tiplist[] = {
get README\n\
dir\n\
(blank line to end macro)",
-
+
"If you want to keep your .netrc's for ftp and ncftp separate, name\n\
ncftp's rc to .ncftprc.",
diff --git a/usr.bin/ncftp/util.c b/usr.bin/ncftp/util.c
index ee2fba3..f8dfd5d 100644
--- a/usr.bin/ncftp/util.c
+++ b/usr.bin/ncftp/util.c
@@ -314,7 +314,7 @@ unsigned long UnLSDate(char *dstr)
cp++;
day += *cp++ - '0';
min = 0;
-
+
(void) time(&now);
t = localtime(&now);
@@ -376,7 +376,7 @@ unsigned long UnMDTMDate(char *dstr)
&ut.tm_hour,
&ut.tm_min,
&ut.tm_sec) == 6)
- {
+ {
--ut.tm_mon;
ut.tm_year -= 1900;
mt = mktime(&ut);
@@ -735,9 +735,9 @@ struct cmd *getcmd(char *name)
continue;
if (strncmp(name, p, len) == 0) {
if (++nmatches > 1) {
- found = ((struct cmd *) -1);
+ found = ((struct cmd *) -1);
goto xx;
- }
+ }
found = c;
} else if (found != NULL)
break;
@@ -796,7 +796,7 @@ char *LocalPath(char *path)
return (path);
}
/* Otherwise we can look at the first word of the path, and
- * try to expand it, like $HOME/ or ~/, or it is a relative path,
+ * try to expand it, like $HOME/ or ~/, or it is a relative path,
* which is okay since we won't really do anything with it.
*/
*cp = 0;
@@ -831,7 +831,7 @@ char *LocalPath(char *path)
}
if (rest == NULL)
(void) strcpy(path, firstent);
- else
+ else
(void) sprintf(path, "%s/%s", firstent, rest);
return (path);
} /* LocalPath */
OpenPOWER on IntegriCloud