5-Mar-85 14:57:59-EST,4264;000000000001 Return-Path: Received: from nlm-vax.ARPA by CU20B.ARPA with TCP; Tue 5 Mar 85 14:57:46-EST Received: by nlm-vax.ARPA (4.12/4.7) id AA03704; Tue, 5 Mar 85 14:58:27 est Date: Tue, 5 Mar 85 14:58:27 est From: randy@nlm-vax (Rand Huntzinger) Message-Id: <8503051958.AA03704@nlm-vax.ARPA> To: iglesias@uci-icsa Subject: Re: Unix shell script for ftp'ing Kermit programs Cc: info-kermit-request@cu20b The following patch, applied to the 4.2 BSD ftp program, will allow mget to work in TENEX mode, as required by my shell script to retrieve Kermit versions from Columbia. It isn't a particularly elegant solution, but it's functional. *** cmds.c Thu Oct 18 15:01:42 1984 --- /usr/src/ucb/ftp/cmds.c Wed Jul 27 00:34:47 1983 *************** *** 1,7 - /* MODIFIED BY Rand S. Huntzinger, 10/18/84, to allow directory listing to - be made while in non-ascii transfer modes, and to permit mget to work - under the same circustances. These changes are in 'ls' and 'remglob' */ - #ifndef lint static char sccsid[] = "@(#)cmds.c 4.9 (Berkeley) 7/26/83"; #endif --- 1,3 ----- #ifndef lint static char sccsid[] = "@(#)cmds.c 4.9 (Berkeley) 7/26/83"; #endif *************** *** 355,361 static FILE *ftemp = NULL; static char **args; int oldverbose, oldhash; - char oldtype[20]; /* So we can use tenex */ char *cp, *mode; if (!doglob) { --- 351,356 ----- static FILE *ftemp = NULL; static char **args; int oldverbose, oldhash; char *cp, *mode; if (!doglob) { *************** *** 370,378 mktemp(temp); oldverbose = verbose, verbose = 0; oldhash = hash, hash = 0; - strcpy(oldtype, typename); - if(strcmp(typename, "ascii")) /* RSH - Force ascii mode */ - setascii(); for (mode = "w"; *++argv != NULL; mode = "a") recvrequest ("NLST", temp, *argv, mode); if(strcmp(oldtype, "ascii")) /* RSH - Reset user mode */ --- 365,370 ----- mktemp(temp); oldverbose = verbose, verbose = 0; oldhash = hash, hash = 0; for (mode = "w"; *++argv != NULL; mode = "a") recvrequest ("NLST", temp, *argv, mode); verbose = oldverbose; hash = oldhash; *************** *** 375,382 setascii(); for (mode = "w"; *++argv != NULL; mode = "a") recvrequest ("NLST", temp, *argv, mode); - if(strcmp(oldtype, "ascii")) /* RSH - Reset user mode */ - call(settype, "type", oldtype, 0); verbose = oldverbose; hash = oldhash; ftemp = fopen(temp, "r"); unlink(temp); --- 367,372 ----- oldhash = hash, hash = 0; for (mode = "w"; *++argv != NULL; mode = "a") recvrequest ("NLST", temp, *argv, mode); verbose = oldverbose; hash = oldhash; ftemp = fopen(temp, "r"); unlink(temp); *************** *** 666,673 char *argv[]; { char *cmd; - char oldtype[20]; - int oldverbose, oldhash; if (argc < 2) argc++, argv[1] = NULL; --- 656,661 ----- char *argv[]; { char *cmd; if (argc < 2) argc++, argv[1] = NULL; *************** *** 680,692 cmd = argv[0][0] == 'l' ? "NLST" : "LIST"; if (strcmp(argv[2], "-") && !globulize(&argv[2])) return; - strcpy(oldtype, typename); - if(strcmp(typename, "ascii")) { /* RSH - make sure ascii */ - oldhash = hash, hash = 0; - oldverbose = verbose, verbose = 0; - call( settype, "type", "ascii", 0); - hash = oldhash; verbose = oldverbose; - } recvrequest(cmd, argv[2], argv[1], "w"); if(strcmp(oldtype, "ascii")) { oldhash = hash, hash = 0; --- 668,673 ----- cmd = argv[0][0] == 'l' ? "NLST" : "LIST"; if (strcmp(argv[2], "-") && !globulize(&argv[2])) return; recvrequest(cmd, argv[2], argv[1], "w"); } *************** *** 688,699 hash = oldhash; verbose = oldverbose; } recvrequest(cmd, argv[2], argv[1], "w"); - if(strcmp(oldtype, "ascii")) { - oldhash = hash, hash = 0; - oldverbose = verbose, verbose = 0; - call(settype, "type", oldtype, 0); - hash = oldhash; verbose = oldverbose; - } } /* --- 669,674 ----- if (strcmp(argv[2], "-") && !globulize(&argv[2])) return; recvrequest(cmd, argv[2], argv[1], "w"); } /*