=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ftp/main.c,v retrieving revision 1.26 retrieving revision 1.27 diff -c -r1.26 -r1.27 *** src/usr.bin/ftp/main.c 1997/04/01 21:19:05 1.26 --- src/usr.bin/ftp/main.c 1997/04/05 19:53:10 1.27 *************** *** 1,4 **** ! /* $OpenBSD: main.c,v 1.26 1997/04/01 21:19:05 millert Exp $ */ /* $NetBSD: main.c,v 1.20 1997/03/16 14:24:21 lukem Exp $ */ /* --- 1,4 ---- ! /* $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,50 **** #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 $"; #endif #endif /* not lint */ --- 44,50 ---- #if 0 static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 10/9/94"; #else ! static char rcsid[] = "$OpenBSD: main.c,v 1.27 1997/04/05 19:53:10 kstailey Exp $"; #endif #endif /* not lint */ *************** *** 74,79 **** --- 74,80 ---- int ch, top, port, rval; struct passwd *pw = NULL; char *cp, homedir[MAXPATHLEN]; + int from_emacs; sp = getservbyname("ftp", "tcp"); if (sp == 0) *************** *** 103,116 **** if (strcmp(cp, "pftp") == 0) passivemode = 1; fromatty = isatty(fileno(stdin)); if (fromatty) { verbose = 1; /* verbose if from a tty */ #ifndef SMALL ! 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) { --- 104,119 ---- 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 ! if (!from_emacs) ! editing = 1; /* editing mode on if from a tty */ #endif } ! 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,131 **** debug++; break; ! case 'e': ! #ifndef SMALL editing = 0; #endif break; --- 127,134 ---- debug++; break; ! case 'e': /* XXX should TERM=dumb be the only way to */ ! #ifndef SMALL /* turn off editing or not? */ editing = 0; #endif break;