summaryrefslogtreecommitdiff
path: root/usr.bin/ftp
diff options
context:
space:
mode:
authorkstailey <kstailey@cvs.openbsd.org>1997-04-05 19:53:11 +0000
committerkstailey <kstailey@cvs.openbsd.org>1997-04-05 19:53:11 +0000
commitf6870d3939ef1cdb8286e0a361f3d4c1d42b04d4 (patch)
treeff91243aabd949ea4f164b1e83e2d526eb47f908 /usr.bin/ftp
parentc3434a52deeea17992db2aeb2f67aac615858469 (diff)
if TERM=dumb disable progress and editing for emacs ange-ftp
Diffstat (limited to 'usr.bin/ftp')
-rw-r--r--usr.bin/ftp/main.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c
index 6183c74a94a..1d94b442032 100644
--- a/usr.bin/ftp/main.c
+++ b/usr.bin/ftp/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.26 1997/04/01 21:19:05 millert Exp $ */
+/* $OpenBSD: main.c,v 1.27 1997/04/05 19:53:10 kstailey Exp $ */
/* $NetBSD: main.c,v 1.20 1997/03/16 14:24:21 lukem Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 10/9/94";
#else
-static char rcsid[] = "$OpenBSD: main.c,v 1.26 1997/04/01 21:19:05 millert Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.27 1997/04/05 19:53:10 kstailey Exp $";
#endif
#endif /* not lint */
@@ -74,6 +74,7 @@ main(argc, argv)
int ch, top, port, rval;
struct passwd *pw = NULL;
char *cp, homedir[MAXPATHLEN];
+ int from_emacs;
sp = getservbyname("ftp", "tcp");
if (sp == 0)
@@ -103,14 +104,16 @@ main(argc, argv)
if (strcmp(cp, "pftp") == 0)
passivemode = 1;
+ from_emacs = !strcmp(getenv("TERM"), "dumb");
fromatty = isatty(fileno(stdin));
if (fromatty) {
verbose = 1; /* verbose if from a tty */
#ifndef SMALL
- editing = 1; /* editing mode on if from a tty */
+ if (!from_emacs)
+ editing = 1; /* editing mode on if from a tty */
#endif
}
- if (isatty(fileno(stdout)))
+ if (isatty(fileno(stdout)) && !from_emacs)
progress = 1; /* progress bar on if going to a tty */
while ((ch = getopt(argc, argv, "adeginpPr:tvV")) != -1) {
@@ -124,8 +127,8 @@ main(argc, argv)
debug++;
break;
- case 'e':
-#ifndef SMALL
+ case 'e': /* XXX should TERM=dumb be the only way to */
+#ifndef SMALL /* turn off editing or not? */
editing = 0;
#endif
break;