and setting times.
-/* $OpenBSD: cmds.c,v 1.15 1997/02/05 04:55:12 millert Exp $ */
-/* $NetBSD: cmds.c,v 1.18 1997/02/01 10:44:54 lukem Exp $ */
+/* $OpenBSD: cmds.c,v 1.16 1997/03/14 04:32:12 millert Exp $ */
+/* $NetBSD: cmds.c,v 1.19 1997/03/13 06:23:11 lukem Exp $ */
/*
* Copyright (c) 1985, 1989, 1993, 1994
#if 0
static char sccsid[] = "@(#)cmds.c 8.6 (Berkeley) 10/9/94";
#else
-static char rcsid[] = "$OpenBSD: cmds.c,v 1.15 1997/02/05 04:55:12 millert Exp $";
+static char rcsid[] = "$OpenBSD: cmds.c,v 1.16 1997/03/14 04:32:12 millert Exp $";
#endif
#endif /* not lint */
if (strcmp(argv[1], p->t_name) == 0)
break;
if (p->t_name == 0) {
- printf("%s: unknown mode\n", argv[1]);
+ printf("%s: unknown mode.\n", argv[1]);
code = -1;
return;
}
if (newtype == p->t_type)
break;
if (p->t_name == 0) {
- printf("ftp: internal error: unknown type %d\n", newtype);
+ warnx("internal error: unknown type %d.", newtype);
return;
}
if (newtype == TYPE_L && bytename[0] != '\0')
if (proxy) {
char *cp, *tp2, tmpbuf[MAXPATHLEN];
- while ((cp = remglob(argv, 0)) != NULL) {
+ while ((cp = remglob(argv, 0, NULL)) != NULL) {
if (*cp == '\0') {
mflag = 0;
continue;
mflag = 1;
oldintr = signal(SIGINT, mabort);
(void)setjmp(jabort);
- while ((cp = remglob(argv, proxy)) != NULL) {
+ while ((cp = remglob(argv, proxy, NULL)) != NULL) {
if (*cp == '\0') {
mflag = 0;
continue;
pswitch(0);
}
printf("Passive mode: %s.\n", onoff(passivemode));
- printf("Mode: %s; Type: %s; Form: %s; Structure: %s\n",
+ printf("Mode: %s; Type: %s; Form: %s; Structure: %s.\n",
modename, typename, formname, structname);
- printf("Verbose: %s; Bell: %s; Prompting: %s; Globbing: %s\n",
+ printf("Verbose: %s; Bell: %s; Prompting: %s; Globbing: %s.\n",
onoff(verbose), onoff(bell), onoff(interactive),
onoff(doglob));
- printf("Store unique: %s; Receive unique: %s\n", onoff(sunique),
+ printf("Store unique: %s; Receive unique: %s.\n", onoff(sunique),
onoff(runique));
- printf("Preserve modification times: %s\n", onoff(preserve));
- printf("Case: %s; CR stripping: %s\n", onoff(mcase), onoff(crflag));
+ printf("Preserve modification times: %s.\n", onoff(preserve));
+ printf("Case: %s; CR stripping: %s.\n", onoff(mcase), onoff(crflag));
if (ntflag) {
printf("Ntrans: (in) %s (out) %s\n", ntin, ntout);
}
else {
- puts("Ntrans: off");
+ puts("Ntrans: off.");
}
if (mapflag) {
printf("Nmap: (in) %s (out) %s\n", mapin, mapout);
}
else {
- puts("Nmap: off");
+ puts("Nmap: off.");
}
- printf("Hash mark printing: %s; Mark count: %d; Progress bar: %s\n",
+ printf("Hash mark printing: %s; Mark count: %d; Progress bar: %s.\n",
onoff(hash), mark, onoff(progress));
- printf("Use of PORT cmds: %s\n", onoff(sendport));
+ printf("Use of PORT cmds: %s.\n", onoff(sendport));
#ifndef SMALLFTP
- printf("Command line editing: %s\n", onoff(editing));
+ printf("Command line editing: %s.\n", onoff(editing));
#endif /* !SMALLFTP */
if (macnum > 0) {
puts("Macros:");
*var = 0;
} else {
printf("usage: %s [ on | off ]\n", argv[0]);
- return -1;
+ return (-1);
}
if (mesg)
printf("%s %s.\n", mesg, onoff(*var));
else {
int nmark = atol(argv[1]);
if (nmark < 1) {
- printf("%s: bad bytecount value\n", argv[1]);
+ printf("%s: bad bytecount value.\n", argv[1]);
code = -1;
return;
}
r = command("CWD %s", argv[1]);
if (r == ERROR && code == 500) {
if (verbose)
- puts("CWD command not recognized, trying XCWD");
+ puts("CWD command not recognized, trying XCWD.");
r = command("XCWD %s", argv[1]);
}
if (r == COMPLETE)
mflag = 1;
oldintr = signal(SIGINT, mabort);
(void)setjmp(jabort);
- while ((cp = remglob(argv, 0)) != NULL) {
+ while ((cp = remglob(argv, 0, NULL)) != NULL) {
if (*cp == '\0') {
mflag = 0;
continue;
goto usage;
if ((argc < 3 && !another(&argc, &argv, "to-name")) || argc > 3) {
usage:
- printf("%s from-name to-name\n", argv[0]);
+ printf("usage: %s from-name to-name\n", argv[0]);
code = -1;
return;
}
(void)signal(SIGINT, old1);
(void)signal(SIGQUIT, old2);
if (pid == -1) {
- warn("%s", "Try again later");
+ warn("Try again later");
code = -1;
}
else {
*/
verbose = 1;
if (command("PWD") == ERROR && code == 500) {
- puts("PWD command not recognized, trying XPWD");
+ puts("PWD command not recognized, trying XPWD.");
(void)command("XPWD");
}
verbose = oldverbose;
}
if (command("MKD %s", argv[1]) == ERROR && code == 500) {
if (verbose)
- puts("MKD command not recognized, trying XMKD");
+ puts("MKD command not recognized, trying XMKD.");
(void)command("XMKD %s", argv[1]);
}
}
}
if (command("RMD %s", argv[1]) == ERROR && code == 500) {
if (verbose)
- puts("RMD command not recognized, trying XRMD");
+ puts("RMD command not recognized, trying XRMD.");
(void)command("XRMD %s", argv[1]);
}
}
buf[sizeof(buf) - 1] = '\0';
if (argc > 1) {
len = strlen(buf);
- len += strlen(strncpy(&buf[len], argv[1], sizeof(buf) - len - 1));
+ len += strlen(strncpy(&buf[len], argv[1],
+ sizeof(buf) - len - 1));
for (i = 2; i < argc && len < sizeof(buf); i++) {
buf[len++] = ' ';
len += strlen(strncpy(&buf[len], argv[i],
}
c = getcmd(argv[1]);
if (c == (struct cmd *) -1) {
- puts("?Ambiguous command");
+ puts("?Ambiguous command.");
(void)fflush(stdout);
code = -1;
return;
}
if (c == 0) {
- puts("?Invalid command");
+ puts("?Invalid command.");
(void)fflush(stdout);
code = -1;
return;
}
if (!c->c_proxy) {
- puts("?Invalid proxy command");
+ puts("?Invalid proxy command.");
(void)fflush(stdout);
code = -1;
return;
oldintr = signal(SIGINT, proxabort);
pswitch(1);
if (c->c_conn && !connected) {
- puts("Not connected");
+ puts("Not connected.");
(void)fflush(stdout);
pswitch(0);
(void)signal(SIGINT, oldintr);
return;
}
if ((argc < 3 && !another(&argc, &argv, "mapout")) || argc > 3) {
- printf("Usage: %s [mapin mapout]\n", argv[0]);
+ printf("usage: %s [mapin mapout]\n", argv[0]);
code = -1;
return;
}
}
}
if (!*cp2) {
- puts("nmap: unbalanced brackets");
+ puts(
+"nmap: unbalanced brackets.");
return (name);
}
match = 1;
}
}
if (!*cp2) {
- puts("nmap: unbalanced brackets");
+ puts(
+"nmap: unbalanced brackets.");
return (name);
}
break;
r = command("CDUP");
if (r == ERROR && code == 500) {
if (verbose)
- puts("CDUP command not recognized, trying XCUP");
+ puts("CDUP command not recognized, trying XCUP.");
r = command("XCUP");
}
if (r == COMPLETE)
{
if (argc != 2)
- puts("restart: offset not specified");
+ puts("restart: offset not specified.");
else {
restart_point = atol(argv[1]);
printf("Restarting at %qd. Execute get, put or append to"
int c;
if (macnum == 16) {
- puts("Limit of 16 macros have already been defined");
+ puts("Limit of 16 macros have already been defined.");
code = -1;
return;
}
if ((argc < 2 && !another(&argc, &argv, "macro name")) || argc > 2) {
- printf("Usage: %s macro_name\n", argv[0]);
+ printf("usage: %s macro_name\n", argv[0]);
code = -1;
return;
}
- if (interactive) {
- puts("Enter macro line by line, terminating it with a null line");
- }
+ if (interactive)
+ puts(
+"Enter macro line by line, terminating it with a null line.");
(void)strncpy(macros[macnum].mac_name, argv[1],
sizeof(macros[macnum].mac_name) - 1);
macros[macnum].mac_name[sizeof(macros[macnum].mac_name) - 1] = '\0';
tmp = macros[macnum].mac_start;
while (tmp != macbuf+4096) {
if ((c = getchar()) == EOF) {
- puts("macdef: end of file encountered");
+ puts("macdef: end of file encountered.");
code = -1;
return;
}
while ((c = getchar()) != '\n' && c != EOF)
/* LOOP */;
if (c == EOF || getchar() == '\n') {
- puts("Macro not defined - 4k buffer exceeded");
+ puts("Macro not defined - 4K buffer exceeded.");
code = -1;
return;
}
{
if (getit(argc, argv, -1, "w"))
- printf("Local file \"%s\" is newer than remote file \"%s\"\n",
+ printf("Local file \"%s\" is newer than remote file \"%s\".\n",
argv[2], argv[1]);
}
+
+/*
+ * Display one file through $PAGER (defaults to "more").
+ */
+void
+page(argc, argv)
+ int argc;
+ char *argv[];
+{
+ int orestart_point, ohash, overbose;
+ char *p, *pager;
+
+ if ((argc < 2 && !another(&argc, &argv, "filename")) || argc > 2) {
+ printf("usage: %s filename\n", argv[0]);
+ code = -1;
+ return;
+ }
+ if (!globulize(&argv[1])) {
+ code = -1;
+ return;
+ }
+ p = getenv("PAGER");
+ if (p == NULL)
+ p = PAGER;
+ if ((pager = malloc(strlen(p) + 2)) == NULL)
+ errx(1, "Can't allocate memory for $PAGER");
+ (void)sprintf(pager, "|%s", p);
+
+ orestart_point = restart_point;
+ ohash = hash;
+ overbose = verbose;
+ restart_point = hash = verbose = 0;
+ recvrequest("RETR", pager, argv[1], "r+w", 1);
+ (void)free(pager);
+ restart_point = orestart_point;
+ hash = ohash;
+ verbose = overbose;
+}
-/* $OpenBSD: cmdtab.c,v 1.6 1997/02/03 01:05:34 millert Exp $ */
-/* $NetBSD: cmdtab.c,v 1.12 1997/01/19 14:19:05 lukem Exp $ */
+/* $OpenBSD: cmdtab.c,v 1.7 1997/03/14 04:32:12 millert Exp $ */
+/* $NetBSD: cmdtab.c,v 1.13 1997/03/13 06:23:12 lukem Exp $ */
/*
* Copyright (c) 1985, 1989, 1993, 1994
#if 0
static char sccsid[] = "@(#)cmdtab.c 8.4 (Berkeley) 10/9/94";
#else
-static char rcsid[] = "$OpenBSD: cmdtab.c,v 1.6 1997/02/03 01:05:34 millert Exp $";
+static char rcsid[] = "$OpenBSD: cmdtab.c,v 1.7 1997/03/14 04:32:12 millert Exp $";
#endif
#endif /* not lint */
char nlisthelp[] = "nlist contents of remote directory";
char nmaphelp[] = "set templates for default file name mapping";
char ntranshelp[] = "set translation table for default file name mapping";
+char pagehelp[] = "view a remote file through your pager";
char passivehelp[] = "enter passive transfer mode";
char porthelp[] = "toggle use of PORT cmd for each data connection";
char preservehelp[] ="toggle preservation of modification time of "
{ "nmap", nmaphelp, 0, 0, 1, CMPL0 setnmap },
{ "ntrans", ntranshelp, 0, 0, 1, CMPL0 setntrans },
{ "open", connecthelp, 0, 0, 1, CMPL0 setpeer },
+ { "page", pagehelp, 1, 1, 1, CMPL(r) page },
{ "passive", passivehelp, 0, 0, 0, CMPL0 setpassive },
{ "preserve", preservehelp, 0, 0, 0, CMPL0 setpreserve },
{ "progress", progresshelp, 0, 0, 0, CMPL0 setprogress },
-/* $OpenBSD: complete.c,v 1.3 1997/02/05 04:55:14 millert Exp $ */
-/* $NetBSD: complete.c,v 1.2 1997/02/01 10:44:57 lukem Exp $ */
+/* $OpenBSD: complete.c,v 1.4 1997/03/14 04:32:13 millert Exp $ */
+/* $NetBSD: complete.c,v 1.3 1997/03/13 06:23:13 lukem Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: complete.c,v 1.3 1997/02/05 04:55:14 millert Exp $";
+static char rcsid[] = "$OpenBSD: complete.c,v 1.4 1997/03/14 04:32:13 millert Exp $";
#endif /* not lint */
/*
comparstr(a, b)
const void *a, *b;
{
- return strcmp(*(char **)a, *(char **)b);
+ return (strcmp(*(char **)a, *(char **)b));
}
/*
wordlen = strlen(word);
if (words->sl_cur == 0)
- return CC_ERROR; /* no choices available */
+ return (CC_ERROR); /* no choices available */
if (words->sl_cur == 1) { /* only once choice available */
strcpy(insertstr, words->sl_str[0]);
if (el_insertstr(el, insertstr + wordlen) == -1)
- return CC_ERROR;
+ return (CC_ERROR);
else
- return CC_REFRESH;
+ return (CC_REFRESH);
}
if (!list) {
strncpy(insertstr, lastmatch, matchlen);
insertstr[matchlen] = '\0';
if (el_insertstr(el, insertstr + wordlen) == -1)
- return CC_ERROR;
+ return (CC_ERROR);
else
/*
* XXX: really want CC_REFRESH_BEEP
*/
- return CC_REFRESH;
+ return (CC_REFRESH);
}
}
putchar('\n');
qsort(words->sl_str, words->sl_cur, sizeof(char *), comparstr);
list_vertical(words);
- return CC_REDISPLAY;
+ return (CC_REDISPLAY);
}
/*
rv = complete_ambiguous(word, list, words);
sl_free(words, 0);
- return rv;
+ return (rv);
}
/*
}
if ((dd = opendir(dir)) == NULL)
- return CC_ERROR;
+ return (CC_ERROR);
words = sl_init();
rv = complete_ambiguous(file, list, words);
sl_free(words, 1);
- return rv;
+ return (rv);
}
/*
{
static StringList *dirlist;
static char lastdir[MAXPATHLEN];
- static int ftpdslashbug;
StringList *words;
char dir[MAXPATHLEN];
char *file, *cp;
- int i, offset;
+ int i;
unsigned char rv;
char *dummyargv[] = { "complete", dir, NULL };
- offset = 0;
if ((file = strrchr(word, '/')) == NULL) {
- strcpy(dir, ".");
+ (void)strcpy(dir, ".");
file = word;
} else {
- if (file == word)
- strcpy(dir, "/");
- else {
- offset = file - word;
- strncpy(dir, word, offset);
- dir[offset] = '\0';
- offset++;
+ cp = file;
+ while (*cp == '/' && cp > word)
+ cp--;
+ if (cp == word) {
+ dir[0] = '/';
+ dir[1] = '\0';
+ } else {
+ (void)strncpy(dir, word, cp - word + 1);
+ dir[cp - word + 1] = '\0';
}
file++;
}
if (dirchange || strcmp(dir, lastdir) != 0) { /* dir not cached */
+ char *emesg;
+ int dirlen, ftpdslashbug;
+
+ dirlen = strlen(dir);
+ ftpdslashbug = 0;
+ if (strcmp(dir, "/") == 0)
+ ftpdslashbug = 1;
+ else if (strcmp(dir, ".") == 0)
+ dirlen = 0;
+ else
+ dirlen++;
if (dirlist != NULL)
sl_free(dirlist, 1);
dirlist = sl_init();
- ftpdslashbug = 0;
mflag = 1;
- while ((cp = remglob(dummyargv, 0)) != NULL) {
+ emesg = NULL;
+ while ((cp = remglob(dummyargv, 0, &emesg)) != NULL) {
char *tcp;
if (!mflag)
/*
* Work around ftpd(1) bug, which puts a // instead
* of / in front of each filename returned by "NLST /".
- * Without this, remote completes of / look ugly.
+ * Without this, remote completes of / don't work.
+ * However, only do this if the bug is present.
*/
- if (dir[0] == '/' && dir[1] == '\0' &&
- cp[0] == '/' && cp[1] == '/') {
- cp++;
- ftpdslashbug = 1;
- }
- tcp = strdup(cp);
+ if (ftpdslashbug && (cp[dirlen] != '/'))
+ ftpdslashbug = 0;
+ tcp = strdup(cp + dirlen + ftpdslashbug);
if (tcp == NULL)
errx(1, "Can't allocate memory for remote dir");
sl_add(dirlist, tcp);
}
- strcpy(lastdir, dir);
+ if (emesg != NULL) {
+ printf("\n%s\n", emesg);
+ return (CC_REDISPLAY);
+ }
+ (void)strcpy(lastdir, dir);
dirchange = 0;
}
words = sl_init();
for (i = 0; i < dirlist->sl_cur; i++) {
cp = dirlist->sl_str[i];
- if (strlen(word) > strlen(cp))
+ if (strlen(file) > strlen(cp))
continue;
- if (strncmp(word, cp, strlen(word)) == 0)
- sl_add(words, cp + offset + ftpdslashbug);
+ if (strncmp(file, cp, strlen(file)) == 0)
+ sl_add(words, cp);
}
rv = complete_ambiguous(file, list, words);
sl_free(words, 0);
- return rv;
+ return (rv);
}
/*
lf = el_line(el);
len = lf->lastchar - lf->buffer;
if (len >= sizeof(line))
- return CC_ERROR;
+ return (CC_ERROR);
strncpy(line, lf->buffer, len);
line[len] = '\0';
cursor_pos = line + (lf->cursor - lf->buffer);
makeargv(); /* build argc/argv of current line */
if (cursor_argo >= sizeof(word))
- return CC_ERROR;
+ return (CC_ERROR);
dolist = 0;
/* if cursor and word is same, list alternatives */
word[cursor_argo] = '\0';
if (cursor_argc == 0)
- return complete_command(word, dolist);
+ return (complete_command(word, dolist));
c = getcmd(margv[0]);
if (c == (struct cmd *)-1 || c == 0)
- return CC_ERROR;
+ return (CC_ERROR);
celems = strlen(c->c_complete);
/* check for 'continuation' completes (which are uppercase) */
cursor_argc = celems;
if (cursor_argc > celems)
- return CC_ERROR;
+ return (CC_ERROR);
switch (c->c_complete[cursor_argc - 1]) {
case 'l': /* local complete */
case 'L':
- return complete_local(word, dolist);
+ return (complete_local(word, dolist));
case 'r': /* remote complete */
case 'R':
if (!connected) {
- puts("\nMust be connected to complete");
- return CC_REDISPLAY;
+ puts("\nMust be connected to complete.");
+ return (CC_REDISPLAY);
}
- return complete_remote(word, dolist);
+ return (complete_remote(word, dolist));
case 'c': /* command complete */
case 'C':
- return complete_command(word, dolist);
+ return (complete_command(word, dolist));
case 'n': /* no complete */
default:
- return CC_ERROR;
+ return (CC_ERROR);
}
- return CC_ERROR;
+ return (CC_ERROR);
}
-/* $OpenBSD: domacro.c,v 1.4 1997/02/03 01:05:36 millert Exp $ */
-/* $NetBSD: domacro.c,v 1.8 1997/01/19 14:19:08 lukem Exp $ */
+/* $OpenBSD: domacro.c,v 1.5 1997/03/14 04:32:13 millert Exp $ */
+/* $NetBSD: domacro.c,v 1.9 1997/03/13 06:23:14 lukem Exp $ */
/*
* Copyright (c) 1985, 1993, 1994
#if 0
static char sccsid[] = "@(#)domacro.c 8.3 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: domacro.c,v 1.4 1997/02/03 01:05:36 millert Exp $";
+static char rcsid[] = "$OpenBSD: domacro.c,v 1.5 1997/03/14 04:32:13 millert Exp $";
#endif
#endif /* not lint */
struct cmd *c;
if (argc < 2 && !another(&argc, &argv, "macro name")) {
- printf("Usage: %s macro_name.\n", argv[0]);
+ printf("usage: %s macro_name\n", argv[0]);
code = -1;
return;
}
makeargv();
c = getcmd(margv[0]);
if (c == (struct cmd *)-1) {
- puts("?Ambiguous command");
+ puts("?Ambiguous command.");
code = -1;
}
else if (c == 0) {
- puts("?Invalid command");
+ puts("?Invalid command.");
code = -1;
}
else if (c->c_conn && !connected) {
code = -1;
}
else {
- if (verbose) {
+ if (verbose)
puts(line);
- }
(*c->c_handler)(margc, margv);
if (bell && c->c_bell) {
(void)putchar('\007');
-/* $NetBSD: extern.h,v 1.11 1997/02/01 10:44:58 lukem Exp $ */
-/* $OpenBSD: extern.h,v 1.8 1997/02/05 04:55:15 millert Exp $ */
+/* $OpenBSD: extern.h,v 1.9 1997/03/14 04:32:14 millert Exp $ */
+/* $NetBSD: extern.h,v 1.12 1997/03/13 06:23:15 lukem Exp $ */
/*-
* Copyright (c) 1994 The Regents of the University of California.
void changetype __P((int, int));
void cmdabort __P((int));
void cmdscanner __P((int));
-int command __P(());
+int command __P((const char *, ...));
#ifndef SMALLFTP
unsigned char complete __P((EditLine *, int));
#endif /* !SMALLFTP */
void ls __P((int, char **));
void mabort __P((int));
void macdef __P((int, char **));
-void makeargv __P(());
+void makeargv __P((void));
void makedir __P((int, char **));
void mdelete __P((int, char **));
void mget __P((int, char **));
void mput __P((int, char **));
char *onoff __P((int));
void newer __P((int, char **));
+void page __P((int, char **));
void progressmeter __P((int));
char *prompt __P((void));
void proxabort __P((int));
void recvrequest __P((const char *, const char *, const char *,
const char *, int));
void reget __P((int, char **));
-char *remglob __P((char **, int));
+char *remglob __P((char **, int, char **));
off_t remotesize __P((const char *, int));
time_t remotemodtime __P((const char *, int));
void removedir __P((int, char **));
void shell __P((int, char **));
void site __P((int, char **));
void sizecmd __P((int, char **));
-char *slurpstring __P(());
+char *slurpstring __P((void));
void status __P((int, char **));
void syst __P((int, char **));
int togglevar __P((int, char **, int *, const char *));
-/* $OpenBSD: fetch.c,v 1.3 1997/02/05 04:55:16 millert Exp $ */
-/* $NetBSD: fetch.c,v 1.2 1997/02/01 10:45:00 lukem Exp $ */
+/* $OpenBSD: fetch.c,v 1.4 1997/03/14 04:32:14 millert Exp $ */
+/* $NetBSD: fetch.c,v 1.3 1997/03/13 06:23:15 lukem Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: fetch.c,v 1.3 1997/02/05 04:55:16 millert Exp $";
+static char rcsid[] = "$OpenBSD: fetch.c,v 1.4 1997/03/14 04:32:14 millert Exp $";
#endif /* not lint */
/*
for (i = 0, buflen = sizeof(buf), cp = buf; i < buflen; cp++, i++) {
if (read(s, cp, 1) != 1)
goto improper;
+ if (*cp == '\r')
+ continue;
if (*cp == '\n')
break;
}
for (i = 0, buflen = sizeof(buf), cp = buf; i < buflen; cp++, i++) {
if (read(s, cp, 1) != 1)
goto improper;
+ if (*cp == '\r')
+ continue;
if (*cp == '\n' && c == '\n')
break;
c = *cp;
{
alarmtimer(0);
- puts("\nhttp fetch aborted");
+ puts("\nhttp fetch aborted.");
(void)fflush(stdout);
longjmp(httpabort, 1);
}
char *xargv[5];
char *cp, *line, *host, *dir, *file, *portnum;
int rval, xargc, argpos;
+ int dirhasglob, filehasglob;
+ char rempath[MAXPATHLEN];
argpos = 0;
}
}
+ dirhasglob = filehasglob = 0;
+ if (doglob) {
+ if (! EMPTYSTRING(dir) &&
+ strpbrk(dir, "*?[]{}") != NULL)
+ dirhasglob = 1;
+ if (! EMPTYSTRING(file) &&
+ strpbrk(file, "*?[]{}") != NULL)
+ filehasglob = 1;
+ }
+
/* Change directories, if necessary. */
- if (! EMPTYSTRING(dir)) {
+ if (! EMPTYSTRING(dir) && !dirhasglob) {
xargv[0] = "cd";
xargv[1] = dir;
xargv[2] = NULL;
if (!verbose)
printf("Retrieving %s/%s\n", dir ? dir : "", file);
- /* Fetch the file. */
+ if (dirhasglob) {
+ snprintf(rempath, sizeof(rempath), "%s/%s", dir, file);
+ file = rempath;
+ }
+
+ /* Fetch the file(s). */
xargv[0] = "get";
xargv[1] = file;
xargv[2] = NULL;
- get(2, xargv);
-
- if ((code / 100) != COMPLETE) /* XXX: is this valid? */
+ if (dirhasglob || filehasglob) {
+ int ointeractive;
+
+ ointeractive = interactive;
+ interactive = 0;
+ xargv[0] = "mget";
+ mget(2, xargv);
+ interactive = 1;
+ } else
+ get(2, xargv);
+
+ if ((code / 100) != COMPLETE)
rval = argpos + 1;
}
if (connected && rval != -1)
-.\" $OpenBSD: ftp.1,v 1.8 1997/02/18 18:04:28 kstailey Exp $
-.\" $NetBSD: ftp.1,v 1.17 1997/02/01 10:45:01 lukem Exp $
+.\" $OpenBSD: ftp.1,v 1.9 1997/03/14 04:32:15 millert Exp $
+.\" $NetBSD: ftp.1,v 1.18 1997/03/13 06:23:16 lukem Exp $
.\"
.\" Copyright (c) 1985, 1989, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" @(#)ftp.1 8.3 (Berkeley) 10/9/94
.\"
-.Dd January 20, 1997
+.Dd February 23, 1997
.Dt FTP 1
.Os BSD 4.2
.Sh NAME
.Nm ftp
http://\fIhost\fR[:\fIport\fR]/\fIfile\fR
.Nm ftp
-\fIhost\fR:\fI/path/file\fR[/]
+\fIhost\fR:[/\fIpath\fR/]\fIfile\fR[/]
.Sh DESCRIPTION
.Nm Ftp
is the user interface to the
.Pp
The latter three usage formats will fetch a file using either the
HTTP or FTP protocols into the current directory.
-This is ideal for scripts.
+This is ideal for scripts. Refer to
+.Sx AUTO-FETCHING FILES
+below for more information.
.Pp
Options may be specified at the command line, or to the
command interpreter.
.It Fl d
Enables debugging.
.It Fl e
-Suppress the use of editline(3). Useful for Emacs ange-ftp.
+Disables command line editing. Useful for Emacs ange-ftp.
.It Fl g
Disables file name globbing.
.It Fl i
the
.Tn FTP
server (see below).
+.It Ic page Ar file
+Retrieve
+.Ic file
+and display with the program defined in
+.Ev PAGER
+(which defaults to
+.Xr more 1 ).
.It Ic passive
Toggle passive mode. If passive mode is turned on
(default is off), the ftp client will
Toggle preservation of modification times on retrieved files.
.It Ic progress
Toggle display of transfer progress bar.
+The progress bar will be disabled for a transfer that has
+.Ar local-file
+as
+.Sq Fl
+or a command that starts with
+.Sq \&| .
+Refer to
+.Sx FILE NAMING CONVENTIONS
+for more information.
.It Ic prompt
Toggle interactive prompting.
Interactive prompting
If successive auto-fetch ftp elements refer to the same host, then
the connection is maintained between transfers, reducing overhead on
connection creation and deletion.
+.Pp
+If
+.Ic file
+contains a glob character and globbing is enabled,
+(see
+.Ic glob ),
+then the equivalent of
+.Ic "mget file"
+is performed.
+.Pp
+If the directory component of
+.Ic file
+contains no globbing characters,
+it is stored in the current directory as the
+.Xr basename 1
+of
+.Ic file .
+Otherwise, the remote name is used as the local name.
.Sh ABORTING A FILE TRANSFER
To abort a file transfer, use the terminal interrupt key
(usually Ctrl-C).
library.
It is enabled with the
.Ic edit
-command, and is enabled by default.
+command, and is enabled by default if input is from a tty.
Previous lines can be recalled and edited with the arrow keys,
and other GNU Emacs-style editing keys may be used as well.
.Pp
For default location of a
.Pa .netrc
file, if one exists.
+.It Ev PAGER
+Used by
+.Ic page
+to display files.
.It Ev SHELL
For default shell.
.It Ev http_proxy
-/* $OpenBSD: ftp.c,v 1.12 1997/02/05 04:55:18 millert Exp $ */
-/* $NetBSD: ftp.c,v 1.22 1997/02/01 10:45:03 lukem Exp $ */
+/* $OpenBSD: ftp.c,v 1.13 1997/03/14 04:32:16 millert Exp $ */
+/* $NetBSD: ftp.c,v 1.23 1997/03/13 06:23:17 lukem Exp $ */
/*
* Copyright (c) 1985, 1989, 1993, 1994
#if 0
static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94";
#else
-static char rcsid[] = "$OpenBSD: ftp.c,v 1.12 1997/02/05 04:55:18 millert Exp $";
+static char rcsid[] = "$OpenBSD: ftp.c,v 1.13 1997/03/14 04:32:16 millert Exp $";
#endif
#endif /* not lint */
#include <string.h>
#include <unistd.h>
#include <utime.h>
+#ifdef __STDC__
+#include <stdarg.h>
+#else
#include <varargs.h>
+#endif
#include "ftp_var.h"
/*VARARGS*/
int
+#ifdef __STDC__
+command(const char *fmt, ...)
+#else
command(va_alist)
-va_dcl
+ va_dcl
+#endif
{
va_list ap;
- char *fmt;
int r;
sig_t oldintr;
+#ifndef __STDC__
+ const char *fmt;
+#endif
abrtflag = 0;
if (debug) {
fputs("---> ", stdout);
+#ifdef __STDC__
+ va_start(ap, fmt);
+#else
va_start(ap);
- fmt = va_arg(ap, char *);
+ fmt = va_arg(ap, const char *);
+#endif
if (strncmp("PASS ", fmt, 5) == 0)
fputs("PASS XXXX", stdout);
else if (strncmp("ACCT ", fmt, 5) == 0)
(void)fflush(stdout);
}
if (cout == NULL) {
- warn("No control connection for command");
+ warnx("No control connection for command.");
code = -1;
return (0);
}
oldintr = signal(SIGINT, cmdabort);
+#ifdef __STDC__
+ va_start(ap, fmt);
+#else
va_start(ap);
fmt = va_arg(ap, char *);
+#endif
vfprintf(cout, fmt, ap);
va_end(ap);
fputs("\r\n", cout);
lostpeer();
if (verbose) {
puts(
-"421 Service not available, remote server has closed connection");
+"421 Service not available, remote server has closed connection.");
(void)fflush(stdout);
}
code = 421;
alarmtimer(0);
mflag = 0;
abrtflag = 0;
- puts("\nsend aborted\nwaiting for remote to finish abort");
+ puts("\nsend aborted\nwaiting for remote to finish abort.");
(void)fflush(stdout);
longjmp(sendabort, 1);
}
sig_t oldinti, oldintr, oldintp;
off_t hashbytes;
char *lmode, buf[BUFSIZ], *bufp;
+ int oprogress;
hashbytes = mark;
direction = "sent";
bytes = 0;
filesize = -1;
+ oprogress = progress;
if (verbose && printnames) {
if (local && *local != '-')
printf("local: %s ", local);
(void)signal(SIGPIPE, oldintp);
if (oldinti)
(void)signal(SIGINFO, oldinti);
+ progress = oprogress;
code = -1;
return;
}
oldintr = signal(SIGINT, abortsend);
oldinti = signal(SIGINFO, psummary);
- if (strcmp(local, "-") == 0)
+ if (strcmp(local, "-") == 0) {
fin = stdin;
- else if (*local == '|') {
+ progress = 0;
+ } else if (*local == '|') {
oldintp = signal(SIGPIPE, SIG_IGN);
fin = popen(local + 1, "r");
if (fin == NULL) {
code = -1;
return;
}
+ progress = 0;
closefunc = pclose;
} else {
fin = fopen(local, "r");
if (oldintp)
(void)signal(SIGPIPE, oldintp);
code = -1;
+ progress = oprogress;
if (closefunc != NULL)
(*closefunc)(fin);
return;
if (rc < 0) {
warn("local: %s", local);
restart_point = 0;
+ progress = oprogress;
if (closefunc != NULL)
(*closefunc)(fin);
return;
if (command("REST %ld", (long) restart_point)
!= CONTINUE) {
restart_point = 0;
+ progress = oprogress;
if (closefunc != NULL)
(*closefunc)(fin);
return;
if (command("%s %s", cmd, remote) != PRELIM) {
(void)signal(SIGINT, oldintr);
(void)signal(SIGINFO, oldinti);
+ progress = oprogress;
if (oldintp)
(void)signal(SIGPIPE, oldintp);
if (closefunc != NULL)
if (command("%s", cmd) != PRELIM) {
(void)signal(SIGINT, oldintr);
(void)signal(SIGINFO, oldinti);
+ progress = oprogress;
if (oldintp)
(void)signal(SIGPIPE, oldintp);
if (closefunc != NULL)
break;
}
progressmeter(1);
+ progress = oprogress;
if (closefunc != NULL)
(*closefunc)(fin);
(void)fclose(dout);
abort:
(void)signal(SIGINT, oldintr);
(void)signal(SIGINFO, oldinti);
+ progress = oprogress;
if (oldintp)
(void)signal(SIGPIPE, oldintp);
if (!cpend) {
alarmtimer(0);
mflag = 0;
abrtflag = 0;
- puts("\nreceive aborted\nwaiting for remote to finish abort");
+ puts("\nreceive aborted\nwaiting for remote to finish abort.");
(void)fflush(stdout);
longjmp(recvabort, 1);
}
off_t hashbytes;
struct stat st;
time_t mtime;
+ int oprogress;
hashbytes = mark;
direction = "received";
bytes = 0;
filesize = -1;
+ oprogress = progress;
is_retr = strcmp(cmd, "RETR") == 0;
if (is_retr && verbose && printnames) {
if (local && *local != '-')
din = dataconn("r");
if (din == NULL)
goto abort;
- if (strcmp(local, "-") == 0)
+ if (strcmp(local, "-") == 0) {
fout = stdout;
- else if (*local == '|') {
+ progress = 0;
+ } else if (*local == '|') {
oldintp = signal(SIGPIPE, SIG_IGN);
fout = popen(local + 1, "w");
if (fout == NULL) {
warn("%s", local+1);
goto abort;
}
+ progress = 0;
closefunc = pclose;
} else {
fout = fopen(local, lmode);
}
bufsize = st.st_blksize;
}
+ if (!(st.st_mode & S_IFREG)) {
+ progress = 0;
+ preserve = 0;
+ }
progressmeter(-1);
switch (curtype) {
if (restart_point &&
lseek(fileno(fout), restart_point, SEEK_SET) < 0) {
warn("local: %s", local);
+ progress = oprogress;
if (closefunc != NULL)
(*closefunc)(fout);
return;
if (fseek(fout, 0L, SEEK_CUR) < 0) {
done:
warn("local: %s", local);
+ progress = oprogress;
if (closefunc != NULL)
(*closefunc)(fout);
return;
}
break2:
if (bare_lfs) {
- printf("WARNING! %d bare linefeeds received in ASCII mode\n",
- bare_lfs);
+ printf(
+"WARNING! %d bare linefeeds received in ASCII mode.\n", bare_lfs);
puts("File may not have transferred correctly.");
}
if (hash && (!progress || filesize < 0)) {
break;
}
progressmeter(1);
+ progress = oprogress;
if (closefunc != NULL)
(*closefunc)(fout);
(void)signal(SIGINT, oldintr);
ut.actime = time(NULL);
ut.modtime = mtime;
if (utime(local, &ut) == -1)
- printf("Can't change modification time on %s to %s",
+ printf(
+ "Can't change modification time on %s to %s",
local, asctime(localtime(&mtime)));
}
}
}
return;
+
abort:
/* abort using RFC959 recommended IP,SYNC sequence */
+ progress = oprogress;
if (oldintp)
(void)signal(SIGPIPE, oldintp);
(void)signal(SIGINT, SIG_IGN);
if (sscanf(pasv, "%d,%d,%d,%d,%d,%d",
&a0, &a1, &a2, &a3, &p0, &p1) != 6) {
- puts("Passive mode address scan failure. Shouldn't happen!");
+ puts(
+"Passive mode address scan failure. Shouldn't happen!");
goto bad;
}
const char *lmode;
{
struct sockaddr_in from;
- int s, fromlen = sizeof(from), tos;
+ int s, fromlen, tos;
+
+ fromlen = sizeof(from);
if (passivemode)
return (fdopen(data, lmode));
}
pswitch(0);
if (!connected) {
- puts("No primary connection");
+ puts("No primary connection.");
pswitch(1);
code = -1;
return;
int nfnd;
struct fd_set mask;
+ if (cout == NULL) {
+ warnx("Lost control connection for abort.");
+ if (ptabflg)
+ code = -1;
+ lostpeer();
+ return;
+ }
+
/*
* send IAC in urgent mode instead of DM because 4.3BSD places oob mark
* after urgent byte rather than before as is protocol now
-/* $OpenBSD: ftp_var.h,v 1.8 1997/02/18 18:04:30 kstailey Exp $ */
-/* $NetBSD: ftp_var.h,v 1.13 1997/02/01 10:45:05 lukem Exp $ */
+/* $OpenBSD: ftp_var.h,v 1.9 1997/03/14 04:32:16 millert Exp $ */
+/* $NetBSD: ftp_var.h,v 1.14 1997/03/13 06:23:19 lukem Exp $ */
/*
* Copyright (c) 1985, 1989, 1993, 1994
#define FTP_PORT 21 /* default if getservbyname("ftp/tcp") fails */
#define HTTP_PORT 80 /* default if getservbyname("http/tcp") fails */
+#define PAGER "more" /* default pager if $PAGER isn't set */
/*
* Options and other state info.
int verbose; /* print messages coming back from server */
int connected; /* connected to server */
int fromatty; /* input is from a terminal */
-int use_editline; /* use the editline(3) routine for input */
int interactive; /* interactively prompt on m* cmds */
int confirmrest; /* confirm rest of current m* cmd */
int debug; /* debugging level */
-/* $OpenBSD: main.c,v 1.21 1997/02/18 18:04:31 kstailey Exp $ */
-/* $NetBSD: main.c,v 1.17 1997/02/01 10:45:07 lukem Exp $ */
+/* $OpenBSD: main.c,v 1.22 1997/03/14 04:32:17 millert Exp $ */
+/* $NetBSD: main.c,v 1.18 1997/03/13 06:23:19 lukem Exp $ */
/*
* Copyright (c) 1985, 1989, 1993, 1994
#if 0
static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 10/9/94";
#else
-static char rcsid[] = "$OpenBSD: main.c,v 1.21 1997/02/18 18:04:31 kstailey Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.22 1997/03/14 04:32:17 millert Exp $";
#endif
#endif /* not lint */
preserve = 1;
verbose = 0;
progress = 0;
+#ifndef SMALLFTP
+ editing = 0;
+#endif
mark = HASHBYTES;
marg_sl = sl_init();
- use_editline = 1; /* use editline if possible */
cp = strrchr(argv[0], '/');
cp = (cp == NULL) ? argv[0] : cp + 1;
passivemode = 1;
fromatty = isatty(fileno(stdin));
- if (fromatty)
+ if (fromatty) {
verbose = 1; /* verbose if from a tty */
+#ifndef SMALLFTP
+ editing = 1; /* editing mode on if from a tty */
+#endif
+ }
+ if (isatty(fileno(stdout)))
+ progress = 1; /* progress bar on if going to a tty */
while ((ch = getopt(argc, argv, "adeginpPr:tvV")) != -1) {
switch (ch) {
break;
case 'e':
- use_editline = 0;
+#ifndef SMALLFTP
+ editing = 0;
+#endif
break;
case 'g':
}
#ifndef SMALLFTP
- editing = 0; /* command line editing off */
- if (fromatty && use_editline) {
- editing = 1; /* editing mode on if a tty */
+ if (fromatty) {
el = el_init(__progname, stdin, stdout); /* init editline */
hist = history_init(); /* init the builtin history */
break;
line[num] = '\0';
} else if (num == sizeof(line) - 2) {
- puts("sorry, input line too long");
+ puts("sorry, input line too long.");
while ((num = getchar()) != '\n' && num != EOF)
/* void */;
break;
if (num == 0)
break;
} else if (num >= sizeof(line)) {
- puts("sorry, input line too long");
+ puts("sorry, input line too long.");
break;
}
memcpy(line, buf, num);
#endif /* !SMALLFTP */
c = getcmd(margv[0]);
if (c == (struct cmd *)-1) {
- puts("?Ambiguous command");
+ puts("?Ambiguous command.");
continue;
}
if (c == 0) {
- puts("?Invalid command");
+ puts("?Invalid command.");
continue;
}
if (c->c_conn && !connected) {
usage()
{
(void)fprintf(stderr,
- "usage: %s [-adginprtvV] [host [port]]\n"
+ "usage: %s [-adeginprtvV] [host [port]]\n"
" %s host:path[/]\n"
" %s ftp://host[:port]/path[/]\n"
" %s http://host[:port]/file\n",
-/* $OpenBSD: ruserpass.c,v 1.5 1997/02/03 01:05:44 millert Exp $ */
-/* $NetBSD: ruserpass.c,v 1.11 1997/01/19 14:19:16 lukem Exp $ */
+/* $OpenBSD: ruserpass.c,v 1.6 1997/03/14 04:32:17 millert Exp $ */
+/* $NetBSD: ruserpass.c,v 1.12 1997/03/13 06:23:20 lukem Exp $ */
/*
* Copyright (c) 1985, 1993, 1994
#if 0
static char sccsid[] = "@(#)ruserpass.c 8.4 (Berkeley) 4/27/95";
#else
-static char rcsid[] = "$OpenBSD: ruserpass.c,v 1.5 1997/02/03 01:05:44 millert Exp $";
+static char rcsid[] = "$OpenBSD: ruserpass.c,v 1.6 1997/03/14 04:32:17 millert Exp $";
#endif
#endif /* not lint */
}
if (macnum == 16) {
puts(
-"Limit of 16 macros have already been defined");
+"Limit of 16 macros have already been defined.");
goto bad;
}
tmp = macros[macnum].mac_name;
tmp++;
}
if (tmp == macbuf + 4096) {
- puts("4K macro buffer exceeded");
+ puts("4K macro buffer exceeded.");
goto bad;
}
break;
-/* $OpenBSD: util.c,v 1.3 1997/02/05 04:55:21 millert Exp $ */
-/* $NetBSD: util.c,v 1.4 1997/02/01 11:26:34 lukem Exp $ */
+/* $OpenBSD: util.c,v 1.4 1997/03/14 04:32:18 millert Exp $ */
+/* $NetBSD: util.c,v 1.5 1997/03/13 06:23:21 lukem Exp $ */
/*
* Copyright (c) 1985, 1989, 1993, 1994
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: util.c,v 1.3 1997/02/05 04:55:21 millert Exp $";
+static char rcsid[] = "$OpenBSD: util.c,v 1.4 1997/03/14 04:32:18 millert Exp $";
#endif /* not lint */
/*
if (argc > 2) {
port = atoi(argv[2]);
if (port <= 0) {
- printf("%s: bad port number-- %s\n", argv[1], argv[2]);
- printf ("usage: %s host-name [port]\n", argv[0]);
+ printf("%s: bad port number '%s'.\n", argv[1], argv[2]);
+ printf("usage: %s host-name [port]\n", argv[0]);
code = -1;
return;
}
if (command("SYST") == COMPLETE && overbose) {
char *cp, c;
c = 0;
- cp = strchr(reply_string+4, ' ');
+ cp = strchr(reply_string + 4, ' ');
if (cp == NULL)
- cp = strchr(reply_string+4, '\r');
+ cp = strchr(reply_string + 4, '\r');
if (cp) {
if (cp[-1] == '.')
cp--;
}
/*
- * `Another' gets another argument, and stores the new argc and argv.
+ * `another' gets another argument, and stores the new argc and argv.
* It reverts to the top level (via main.c's intr()) on EOF/error.
*
* Returns false if no new arguments have been added.
int len = strlen(line), ret;
if (len >= sizeof(line) - 3) {
- puts("sorry, arguments too long");
+ puts("sorry, arguments too long.");
intr();
}
printf("(%s) ", prompt);
return (ret);
}
+/*
+ * glob files given in argv[] from the remote server.
+ * if errbuf isn't NULL, store error messages there instead
+ * of writing to the screen.
+ */
char *
-remglob(argv, doswitch)
+remglob(argv, doswitch, errbuf)
char *argv[];
int doswitch;
+ char **errbuf;
{
char temp[MAXPATHLEN];
static char buf[MAXPATHLEN];
char *cp, *mode;
if (!mflag) {
- if (!doglob) {
+ if (!doglob)
args = NULL;
- }
else {
if (ftemp) {
(void)fclose(ftemp);
if (temp[len-1] != '/')
temp[len++] = '/';
(void)strcpy(&temp[len], TMPFILE);
-;
if ((fd = mkstemp(temp)) < 0) {
warn("unable to create temporary file %s", temp);
return (NULL);
}
close(fd);
- oldverbose = verbose, verbose = 0;
- oldhash = hash, hash = 0;
- if (doswitch) {
+ oldverbose = verbose;
+ verbose = (errbuf != NULL) ? -1 : 0;
+ oldhash = hash;
+ hash = 0;
+ if (doswitch)
pswitch(!proxy);
- }
for (mode = "w"; *++argv != NULL; mode = "a")
- recvrequest ("NLST", temp, *argv, mode, 0);
- if (doswitch) {
- pswitch(!proxy);
- }
- verbose = oldverbose; hash = oldhash;
+ recvrequest("NLST", temp, *argv, mode, 0);
+ if ((code / 100) != COMPLETE) {
+ if (errbuf != NULL)
+ *errbuf = reply_string;
+ }
+ if (doswitch)
+ pswitch(!proxy);
+ verbose = oldverbose;
+ hash = oldhash;
ftemp = fopen(temp, "r");
(void)unlink(temp);
if (ftemp == NULL) {
- puts("can't find list of remote files, oops");
+ if (errbuf == NULL)
+ puts("can't find list of remote files, oops.");
+ else
+ *errbuf =
+ "can't find list of remote files, oops.";
return (NULL);
}
}
if (fgets(buf, sizeof(buf), ftemp) == NULL) {
- (void)fclose(ftemp), ftemp = NULL;
+ (void)fclose(ftemp);
+ ftemp = NULL;
return (NULL);
}
if ((cp = strchr(buf, '\n')) != NULL)
return (0);
case 'p':
interactive = 0;
- puts("Interactive mode: off");
+ puts("Interactive mode: off.");
break;
case 'a':
confirmrest = 1;
- printf("Prompting off for duration of %s\n", cmd);
+ printf("Prompting off for duration of %s.\n", cmd);
break;
}
return (1);
if (command("SIZE %s", file) == COMPLETE)
sscanf(reply_string, "%*s %qd", &size);
else if (noisy && debug == 0)
- printf("%s\n", reply_string);
+ puts(reply_string);
verbose = overbose;
return (size);
}
timebuf.tm_isdst = -1;
rtime = mktime(&timebuf);
if (rtime == -1 && (noisy || debug != 0))
- printf("Can't convert %s to a time\n", reply_string);
+ printf("Can't convert %s to a time.\n", reply_string);
else
rtime += timebuf.tm_gmtoff; /* conv. local -> GMT */
} else if (noisy && debug == 0)