home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume39 / ncftp / patch04 < prev    next >
Encoding:
Text File  |  1993-09-16  |  34.7 KB  |  1,252 lines

  1. Newsgroups: comp.sources.misc
  2. From: mgleason@cse.unl.edu (Mike Gleason)
  3. Subject: v39i090:  ncftp - Alternative User Interface for FTP, v1.5.0, Patch04
  4. Message-ID: <1993Sep16.211537.5615@sparky.sterling.com>
  5. X-Md4-Signature: c09a7dd7dc32b62f175247d7c3ebf83e
  6. Sender: kent@sparky.sterling.com (Kent Landfield)
  7. Organization: NCEMRSoft
  8. Date: Thu, 16 Sep 1993 21:15:37 GMT
  9. Approved: kent@sparky.sterling.com
  10.  
  11. Submitted-by: mgleason@cse.unl.edu (Mike Gleason)
  12. Posting-number: Volume 39, Issue 90
  13. Archive-name: ncftp/patch04
  14. Environment: UNIX, ANSI-C, !SVR4
  15. Patch-To: ncftp: Volume 39, Issue 53-57
  16.  
  17. This is the fourth official patch to ncftp 1.5.  This patch fixes some
  18. significant bugs, so if you hadn't upgraded to 1.5.3 yet, I recommend
  19. you apply all four patches to upgrade to 1.5.4.
  20.  
  21. As usual, you'll need the sources with the 3 previous patches applied
  22. for this to work.
  23.  
  24. There are supposed to be tabs in this patch. Make sure your newsreader isn't
  25. converting them to spaces; if you have problems you may want to check to see
  26. if your 'patch' program can handle munged tabs (like patch -l, perhaps).
  27.  
  28. I'll put up the whole 1.5.4 distribution up for ftp as:
  29.   cse.unl.edu:/pub/mgleason/ncftp154.tar.z
  30. Don't call during business hours -- you won't be able to download it.
  31.  
  32. Changes:
  33.  * v1.5.4 - September 14, 1993.
  34.  *  Fixed bug where non-unix sites were hanging after listings.  Better
  35.  *  SVR4 support.  Fixed bug during an ascii transfer with debug mode
  36.  *  on.  Now checking the system type after a successful login, because
  37.  *  some sites didn't allow commands to be executed until logged in; this
  38.  *  prevents one (the only?) instance of the elusive short-file bug, because
  39.  *  files were being fetched with ascii mode on.  Now checking for half-
  40.  *  bright mode if boldface isn't available.  Numeric-only site abbreviations
  41.  *  no longer accepted, so numbers will be treated only as indices from the
  42.  *  open 'menu.'  You can include <term.h> for the 'tgetstr' prototype,
  43.  *  if you define TERMH.  termcap_get() tweaked.  Fixed bug where macros
  44.  *  from the previous site were still present when you opened a new site.
  45.  *  Fixed bug where colon-mode paths were truncated.  Setting tenex mode
  46.  *  automatically when you open a TOPS20 site.  Looking for <getline.h>
  47.  *  instead of <getline/getline.h>; have to leave <readline/readline.h>,
  48.  *  because that header also includes stuff like <readline/keymaps.h>.
  49.  *  Catman support added to Makefile.  Fixed problem with terminfo, where
  50.  *  $<2> etc., was not being removed from the terminal control strings.
  51.  */
  52.  
  53. diff -c ./Makefile ../ncftp154/Makefile
  54. *** ./Makefile    Thu Sep  2 01:23:01 1993
  55. --- ../ncftp154/Makefile    Wed Sep 15 18:53:41 1993
  56. ***************
  57. *** 57,62 ****
  58. --- 57,63 ----
  59.   #LIBS = -lgetline
  60.   #LIBS = -lreadline -lcurses
  61.   #LIBS = ../lib/Rconnect.o
  62. + #LIBS = -lnet -lnsl -lsocket -lcurses
  63.   
  64.   
  65.   # If the libraries are in a non-standard directory, or you if want to use
  66. ***************
  67. *** 75,93 ****
  68.   #
  69.   # For READLINE, provide a path which would find <readline/readline.h>,
  70.   #   so you would put the parent directory of the readline directory below.
  71. ! #   If you had '/usr/local/readline' you would use -I/usr/local.
  72. ! # For GETLINE, the same thing for <getline/getline.h>
  73.   #--------------------------------------------------------------------------
  74.   HDRDIRS =
  75. ! #HDRDIRS = -I..   # I have ../getline and ../readline directories.
  76. ! #HDRDIRS = -I.    # Maybe you have ./getline and ./readline directories.
  77.   
  78.   
  79.   # If you want to 'make install,' edit these variables, otherwise don't
  80.   # worry about it.
  81.   #--------------------------------------------------------------------------
  82. ! BINDIR = /usr/local
  83.   MANDIR = /usr/man/man1
  84.   RM = rm -f
  85.   CP = cp
  86.   
  87. --- 76,108 ----
  88.   #
  89.   # For READLINE, provide a path which would find <readline/readline.h>,
  90.   #   so you would put the parent directory of the readline directory below.
  91. ! #   If you had '/usr/local/readline/readline.h' you would use
  92. ! #   -I/usr/local.
  93. ! #
  94. ! # For GETLINE, a little different. Just supply a path that would find
  95. ! #   <getline.h>.  If you had '/usr/local/getline/getline.h' you would use
  96. ! #   -I/usr/local/getline.
  97.   #--------------------------------------------------------------------------
  98.   HDRDIRS =
  99. ! #HDRDIRS = -I../getline
  100. ! #HDRDIRS = -I..
  101.   
  102.   
  103.   # If you want to 'make install,' edit these variables, otherwise don't
  104.   # worry about it.
  105. + # To install MAN style pages, set MANDIR to the proper location.
  106. + # To install CATMAN style pages, set CATMANDIR, NROFF, and PACK to the proper
  107. + # locations.
  108. + # To inhibit the installation of either, unset MANDIR/CATMANDIR.
  109.   #--------------------------------------------------------------------------
  110. ! BINDIR = /usr/lbin
  111.   MANDIR = /usr/man/man1
  112. + #MANDIR = 
  113. + CATMANDIR = /usr/catman/LOCAL/g1
  114. + #CATMANDIR =
  115. + NROFF    = /usr/ucb/nroff
  116. + PACK    = pack
  117. + TEST    = test
  118.   RM = rm -f
  119.   CP = cp
  120.   
  121. ***************
  122. *** 110,115 ****
  123. --- 125,131 ----
  124.   
  125.   NAME = ncftp
  126.   MAN = ncftp.1
  127. + CATMAN = ncftp.z
  128.   ALL = $(SRCS) $(HEADERS) patchlevel.h Blurb README Makefile $(MAN) \
  129.   v2_Note
  130.   
  131. ***************
  132. *** 121,136 ****
  133.   $(NAME): $(OBJS)
  134.       $(CC) $(LFLAGS) $(LIBDIRS) $(OBJS)  -o $(NAME) $(LIBS)
  135.   
  136. ! install: $(NAME)
  137.       $(CP) $(NAME) $(BINDIR)/$(NAME)
  138.       $(CP) $(MAN)  $(MANDIR)/$(MAN)
  139.   
  140.   uninstall:
  141.       $(RM) $(BINDIR)/$(NAME)
  142.       $(RM) $(MANDIR)/$(MAN)
  143.   
  144.   cmds.o:
  145. !     $(C_COMPILE2) cmds.c -c -o cmds.o
  146.   
  147.   .c.o:
  148.       $(C_COMPILE) -c $<
  149. --- 137,168 ----
  150.   $(NAME): $(OBJS)
  151.       $(CC) $(LFLAGS) $(LIBDIRS) $(OBJS)  -o $(NAME) $(LIBS)
  152.   
  153. ! install: $(NAME) $(CATMAN)
  154.       $(CP) $(NAME) $(BINDIR)/$(NAME)
  155. +     @if $(TEST) -n '$(MANDIR)'; then \
  156. +         $(MAKE) install_man ; else true ;  fi
  157. +     @if $(TEST) -n '$(CATMANDIR)'; then \
  158. +         $(MAKE) install_catman ; else true ;  fi
  159. + install_man: 
  160.       $(CP) $(MAN)  $(MANDIR)/$(MAN)
  161.   
  162. + install_catman:  $(CATMAN)
  163. +     $(CP) $(CATMAN)  $(CATMANDIR)/$(CATMAN)
  164.   uninstall:
  165.       $(RM) $(BINDIR)/$(NAME)
  166.       $(RM) $(MANDIR)/$(MAN)
  167. +     $(RM) $(CATMANDIR)/$(CATMAN)
  168.   
  169. + $(CATMAN): $(MAN)
  170. +     rm -f tmp
  171. +     $(NROFF) -man -Tlp $(MAN) > tmp
  172. +     $(PACK) -f tmp
  173. +     mv tmp.z $(CATMAN)
  174.   cmds.o:
  175. !     $(C_COMPILE2) cmds.c -c
  176.   
  177.   .c.o:
  178.       $(C_COMPILE) -c $<
  179. ***************
  180. *** 149,154 ****
  181. --- 181,187 ----
  182.   cmds.o: ftprc.h 
  183.   cmds.o: getpass.h 
  184.   cmds.o: glob.h 
  185. + cmds.o: open.h 
  186.   cmds.o: set.h 
  187.   cmds.o: defaults.h 
  188.   cmds.o: copyright.h 
  189. Only in ../ncftp154: NcMakefile
  190. diff -c ./README ../ncftp154/README
  191. *** ./README    Thu Sep  2 01:23:01 1993
  192. --- ../ncftp154/README    Wed Sep 15 18:53:41 1993
  193. ***************
  194. *** 105,111 ****
  195.       Hewlett-Packard HP-UX:  If you have 7.0, you'll need to find
  196.         a copy of <ftp.h> from somewhere (8.0 has it though). Then
  197.         set CFLAGS= -Aa.  You may also need to use gcc if your
  198. !       compiler is non-ANSI.
  199.   
  200.       SCO Unix:  Add -DSCO324 or -DSCO322 (as appropriate) to SDEFS,
  201.         and -lsocket to LIBS.
  202. --- 105,115 ----
  203.       Hewlett-Packard HP-UX:  If you have 7.0, you'll need to find
  204.         a copy of <ftp.h> from somewhere (8.0 has it though). Then
  205.         set CFLAGS= -Aa.  You may also need to use gcc if your
  206. !       compiler is non-ANSI.  Note that for HP-UX, the default
  207. !       terminal escape codes are for HP terminals, so you should
  208. !       probably link termcap/curses in so it will get the ANSI
  209. !       sequences if you're on a vt100, etc., terminal connected
  210. !       to your HP-UX machine.
  211.   
  212.       SCO Unix:  Add -DSCO324 or -DSCO322 (as appropriate) to SDEFS,
  213.         and -lsocket to LIBS.
  214. diff -c ./cmds.c ../ncftp154/cmds.c
  215. *** ./cmds.c    Thu Sep  2 01:23:01 1993
  216. --- ../ncftp154/cmds.c    Wed Sep 15 18:53:42 1993
  217. ***************
  218. *** 40,45 ****
  219. --- 40,46 ----
  220.   #include "ftprc.h"
  221.   #include "getpass.h"
  222.   #include "glob.h"
  223. + #include "open.h"
  224.   #include "set.h"
  225.   #include "defaults.h"
  226.   #include "copyright.h"
  227. ***************
  228. *** 122,134 ****
  229.       string lsline;
  230.       long size = 0L;
  231.       int n, v;
  232. !     struct lslist *saved;
  233.       
  234.       *mod_time = 0;
  235.       v = verbose; verbose = V_QUIET;
  236.       is_ls = 1;
  237.       buffer_only = 1;
  238. !     saved = lshead;
  239.       lshead = NULL;
  240.       (void) recvrequest("LIST", "-", fName, "w");
  241.       is_ls = 0;
  242. --- 123,136 ----
  243.       string lsline;
  244.       long size = 0L;
  245.       int n, v;
  246. !     struct lslist *savedh, *savedt;
  247.       
  248.       *mod_time = 0;
  249.       v = verbose; verbose = V_QUIET;
  250.       is_ls = 1;
  251.       buffer_only = 1;
  252. !     savedh = lshead;
  253. !     savedt = lstail;
  254.       lshead = NULL;
  255.       (void) recvrequest("LIST", "-", fName, "w");
  256.       is_ls = 0;
  257. ***************
  258. *** 136,147 ****
  259.       verbose = v;
  260.       if (lshead == NULL) {
  261.           PurgeLineBuffer();
  262. !         lshead = saved;
  263.           goto aa;
  264.       }
  265.       (void) Strncpy(lsline, lshead->string);
  266.       PurgeLineBuffer();
  267. !     lshead = saved;
  268.   
  269.       if (code >= 400 && code < 500)
  270.           goto aa;
  271. --- 138,151 ----
  272.       verbose = v;
  273.       if (lshead == NULL) {
  274.           PurgeLineBuffer();
  275. !         lshead = savedh;
  276. !         lstail = savedt;
  277.           goto aa;
  278.       }
  279.       (void) Strncpy(lsline, lshead->string);
  280.       PurgeLineBuffer();
  281. !     lshead = savedh;
  282. !     lstail = savedt;
  283.   
  284.       if (code >= 400 && code < 500)
  285.           goto aa;
  286. ***************
  287. *** 428,434 ****
  288.           size_t len = strlen(remote_file);
  289.   
  290.           /* Run compressed remote files through zcat, then the pager. */
  291. !         if (strlen(remote_file) > 2 && (remote_file[len - 1] == 'Z' || remote_file[len - 1] == 'z') && remote_file[len - 2] == '.') {
  292.               (void) _settype("b");
  293.               (void) sprintf(local_file, "|%s ", ZCAT);
  294.               argv[2] = Strncat(local_file, pager);
  295. --- 432,441 ----
  296.           size_t len = strlen(remote_file);
  297.   
  298.           /* Run compressed remote files through zcat, then the pager. */
  299. !         if (strlen(remote_file) > (size_t)2 &&
  300. !             (remote_file[len - 1] == 'Z' || remote_file[len - 1] == 'z') &&
  301. !             remote_file[len - 2] == '.')
  302. !         {
  303.               (void) _settype("b");
  304.               (void) sprintf(local_file, "|%s ", ZCAT);
  305.               argv[2] = Strncat(local_file, pager);
  306. ***************
  307. *** 1035,1040 ****
  308. --- 1042,1048 ----
  309.           (void) command(str);
  310.       }
  311.       logged_in = 1;
  312. +     CheckRemoteSystemType(0);
  313.       return NOERR;
  314.   }    /* do_user */
  315.   
  316. ***************
  317. *** 1699,1705 ****
  318.       char    *DStrs[40];
  319.       int        nDStrs = 0, i, j;
  320.   
  321. !     (void) printf("%s\n%-30s %s\n", version, "Author:",
  322.           "Mike Gleason, NCEMRSoft (mgleason@cse.unl.edu).");
  323.   
  324.   /* Now entering CPP hell... */
  325. --- 1707,1714 ----
  326.       char    *DStrs[40];
  327.       int        nDStrs = 0, i, j;
  328.   
  329. !     (void) printf("%-30s %s\n", "NcFTP Version:", version);
  330. !     (void) printf("%-30s %s\n", "Author:",
  331.           "Mike Gleason, NCEMRSoft (mgleason@cse.unl.edu).");
  332.   
  333.   /* Now entering CPP hell... */
  334. ***************
  335. *** 1759,1764 ****
  336. --- 1768,1776 ----
  337.   #endif
  338.   #ifdef SYSSELECTH
  339.       DStrs[nDStrs++] = "SYSSELECTH";
  340. + #endif
  341. + #ifdef TERMH
  342. +     DStrs[nDStrs++] = "TERMH";
  343.   #endif
  344.   #ifdef NO_UNISTDH 
  345.       DStrs[nDStrs++] = "NO_UNISTDH";
  346. diff -c ./ftp.c ../ncftp154/ftp.c
  347. *** ./ftp.c    Thu Sep  2 01:23:01 1993
  348. --- ../ncftp154/ftp.c    Wed Sep 15 18:53:43 1993
  349. ***************
  350. *** 152,158 ****
  351.   #ifdef SOCKS
  352.       while (Rconnect(s, (struct sockaddr *) &hisctladdr, (int) sizeof (hisctladdr)) < 0) {
  353.   #else
  354. !     while (connect(s, (struct sockaddr *) &hisctladdr, (int) sizeof (hisctladdr)) < 0) {
  355.   #endif
  356.           if (hp && hp->h_addr_list[1]) {
  357.               (void) sprintf(errstr, "connect error to address %s",
  358. --- 152,158 ----
  359.   #ifdef SOCKS
  360.       while (Rconnect(s, (struct sockaddr *) &hisctladdr, (int) sizeof (hisctladdr)) < 0) {
  361.   #else
  362. !     while (Connect(s, &hisctladdr, sizeof (hisctladdr)) < 0) {
  363.   #endif
  364.           if (hp && hp->h_addr_list[1]) {
  365.               (void) sprintf(errstr, "connect error to address %s",
  366. ***************
  367. *** 374,380 ****
  368.   
  369.   
  370.   
  371. ! int command(char *cmd)
  372.   {
  373.       int r;
  374.       Sig_t oldintr;
  375. --- 374,380 ----
  376.   
  377.   
  378.   
  379. ! int CommandWithFlags(char *cmd, int flags)
  380.   {
  381.       int r;
  382.       Sig_t oldintr;
  383. ***************
  384. *** 407,419 ****
  385.   #endif /* !SCO324 */
  386.       (void) fflush(cout);
  387.       cpend = 1;
  388. !     r = getreply(strcmp(cmd, "QUIT") == 0);
  389.       if (abrtflag && oldintr != SIG_IGN && oldintr != NULL)
  390.           (*oldintr)(0);
  391.       (void) Signal(SIGINT, oldintr);
  392.       return(r);
  393.   }    /* command */
  394.   
  395.   
  396.   
  397.   
  398. --- 407,436 ----
  399.   #endif /* !SCO324 */
  400.       (void) fflush(cout);
  401.       cpend = 1;
  402. !     r = (flags == WAIT_FOR_REPLY) ? getreply(strcmp(cmd, "QUIT") == 0) : 0;
  403.       if (abrtflag && oldintr != SIG_IGN && oldintr != NULL)
  404.           (*oldintr)(0);
  405.       (void) Signal(SIGINT, oldintr);
  406.       return(r);
  407. + }    /* CommandWithFlags */
  408. + /* This stub runs 'CommandWithFlags' above, telling it to wait for
  409. +  * reply after the command is sent.
  410. +  */
  411. + int command(char *cmd)
  412. + {
  413. +     CommandWithFlags(cmd, WAIT_FOR_REPLY);
  414.   }    /* command */
  415.   
  416. + /* This stub runs 'CommandWithFlags' above, telling it to NOT wait for
  417. +  * reply after the command is sent.
  418. +  */
  419. + int command_noreply(char *cmd)
  420. + {
  421. +     CommandWithFlags(cmd, DONT_WAIT_FOR_REPLY);
  422. + }    /* command */
  423.   
  424.   
  425.   
  426. ***************
  427. *** 636,642 ****
  428.       if (!ansi_escapes && (cur_progress_meter == pr_philbar))
  429.           cur_progress_meter = pr_dots;
  430.   
  431. !     (void) gettimeofday(&start, (struct timezone *)0);
  432.       now_sec = start.tv_sec;
  433.   
  434.       switch (cur_progress_meter) {
  435. --- 653,659 ----
  436.       if (!ansi_escapes && (cur_progress_meter == pr_philbar))
  437.           cur_progress_meter = pr_dots;
  438.   
  439. !     (void) Gettimeofday(&start);
  440.       now_sec = start.tv_sec;
  441.   
  442.       switch (cur_progress_meter) {
  443. ***************
  444. *** 681,687 ****
  445.       str32 spec;
  446.   
  447.       next_report += xferbufsize;
  448. !     (void) gettimeofday(&stop, (struct timezone *)0);
  449.       if ((stop.tv_sec > now_sec) || finish_up && file_size) {
  450.           switch (cur_progress_meter) {
  451.               case pr_none:
  452. --- 698,704 ----
  453.       str32 spec;
  454.   
  455.       next_report += xferbufsize;
  456. !     (void) Gettimeofday(&stop);
  457.       if ((stop.tv_sec > now_sec) || finish_up && file_size) {
  458.           switch (cur_progress_meter) {
  459.               case pr_none:
  460. ***************
  461. *** 900,926 ****
  462.       if (setjmp(sendabort))
  463.           goto Abort;
  464.   
  465.       if (remote) {
  466.           (void) sprintf(str, "%s %s", cmd, remote);
  467. !         if (command(str) != PRELIM) {
  468. !             (void) Signal(SIGINT, oldintr);
  469. !             if (oldintp)
  470. !                 (void) Signal(SIGPIPE, oldintp);
  471. !             close_file(&fin, filetype);
  472. !             goto xx;
  473. !         }
  474. !     } else
  475. !         if (command(cmd) != PRELIM) {
  476. !             (void) Signal(SIGINT, oldintr);
  477. !             if (oldintp)
  478. !                 (void) Signal(SIGPIPE, oldintp);
  479. !             close_file(&fin, filetype);
  480. !             goto xx;
  481. !         }
  482.       dout = dataconn(mode);
  483.       if (dout == NULL)
  484.           goto Abort;
  485. !     (void) gettimeofday(&start, (struct timezone *)0);
  486.       oldintp = Signal(SIGPIPE, SIG_IGN);
  487.       if (do_reports = (filetype == IS_FILE && NOT_VQUIET))
  488.           do_reports = start_progress(1, local);
  489. --- 917,967 ----
  490.       if (setjmp(sendabort))
  491.           goto Abort;
  492.   
  493. + #ifdef TRY_NOREPLY
  494.       if (remote) {
  495.           (void) sprintf(str, "%s %s", cmd, remote);
  496. !         (void) command_noreply(str);
  497. !     } else {
  498. !         (void) command_noreply(cmd);
  499. !     }
  500.       dout = dataconn(mode);
  501.       if (dout == NULL)
  502.           goto Abort;
  503. !     if(getreply(0) != PRELIM) {
  504. !         (void) Signal(SIGINT, oldintr);
  505. !          if (oldintp)
  506. !              (void) Signal(SIGPIPE, oldintp);
  507. !          close_file(&fin, filetype);
  508. !          return -1;
  509. !      }
  510. ! #else
  511. !      if (remote) {
  512. !          (void) sprintf(str, "%s %s", cmd, remote);
  513. !          if (command(str) == PRELIM) {
  514. !              (void) Signal(SIGINT, oldintr);
  515. !              if (oldintp)
  516. !                  (void) Signal(SIGPIPE, oldintp);
  517. !              close_file(&fin, filetype);
  518. !              goto xx;
  519. !          }
  520. !      } else {
  521. !          if (command(cmd) == PRELIM) {
  522. !              (void) Signal(SIGINT, oldintr);
  523. !              if (oldintp)
  524. !                  (void) Signal(SIGPIPE, oldintp);
  525. !              close_file(&fin, filetype);
  526. !              goto xx;
  527. !          }
  528. !      }
  529. !      dout = dataconn(mode);
  530. !      if (dout == NULL)
  531. !          goto Abort;
  532. ! #endif
  533. !     (void) Gettimeofday(&start);
  534.       oldintp = Signal(SIGPIPE, SIG_IGN);
  535.       if (do_reports = (filetype == IS_FILE && NOT_VQUIET))
  536.           do_reports = start_progress(1, local);
  537. ***************
  538. *** 1121,1128 ****
  539.           (void) sprintf(str, "%s %s", ftpcmd, remote);
  540.       else
  541.           (void) Strncpy(str, ftpcmd);
  542. !         
  543.       if (command(str) != PRELIM)
  544.           result = -1;
  545.       return (result);
  546.   }    /* IssueCommand */
  547. --- 1162,1173 ----
  548.           (void) sprintf(str, "%s %s", ftpcmd, remote);
  549.       else
  550.           (void) Strncpy(str, ftpcmd);
  551. !     
  552. ! #ifdef TRY_NOREPLY
  553. !     if (command_noreply(str) != PRELIM)
  554. ! #else
  555.       if (command(str) != PRELIM)
  556. + #endif
  557.           result = -1;
  558.       return (result);
  559.   }    /* IssueCommand */
  560. ***************
  561. *** 1406,1411 ****
  562. --- 1451,1460 ----
  563.   
  564.       oldtype = SetToAsciiForLS(is_retr, curtype);
  565.   
  566. +      /* Issue the NLST command but don't wait for the reply.  Some FTP 
  567. +       * servers make the data connection before issuing the 
  568. +       * "150 Opening ASCII mode data connection for /bin/ls" reply.
  569. +       */
  570.       if (IssueCommand(cmd, remote))
  571.           goto xx;
  572.       
  573. ***************
  574. *** 1415,1420 ****
  575. --- 1464,1474 ----
  576.       if ((din = dataconn("r")) == NULL)
  577.           goto Abort;
  578.   
  579. + #ifdef TRY_NOREPLY
  580. +      /* Now get the reply we skipped above. */
  581. +      (void) getreply(0);
  582. + #endif
  583.       do_reports = NOT_VQUIET && is_retr && filetype == IS_FILE;
  584.       if (do_reports)
  585.           do_reports = start_progress(0, local);
  586. ***************
  587. *** 1444,1449 ****
  588. --- 1498,1504 ----
  589.           (void) Signal(SIGPIPE, SIG_IGN);
  590.           (void) Signal(SIGINT, SIG_IGN);
  591.       }    
  592. +     CloseData();
  593.       (void) getreply(0);
  594.       ResetOldType(oldtype);
  595.   
  596. ***************
  597. *** 1541,1547 ****
  598.   #ifdef SOCKS
  599.       if (Rbind(data, (struct sockaddr *)&data_addr, sizeof (data_addr), hisctladdr.sin_addr.s_addr) < 0) {
  600.   #else
  601. !     if (bind(data, (struct sockaddr *)&data_addr, sizeof (data_addr)) < 0) {
  602.   #endif
  603.           PERROR("initconn", "bind");
  604.           goto bad;
  605. --- 1596,1602 ----
  606.   #ifdef SOCKS
  607.       if (Rbind(data, (struct sockaddr *)&data_addr, sizeof (data_addr), hisctladdr.sin_addr.s_addr) < 0) {
  608.   #else
  609. !     if (Bind(data, &data_addr, sizeof (data_addr)) < 0) {
  610.   #endif
  611.           PERROR("initconn", "bind");
  612.           goto bad;
  613. ***************
  614. *** 1600,1606 ****
  615.   #ifdef SOCKS
  616.       s = Raccept(data, (struct sockaddr *) &from, &fromlen);
  617.   #else
  618. !     s = accept(data, (struct sockaddr *) &from, &fromlen);
  619.   #endif
  620.       if (s < 0) {
  621.           PERROR("dataconn", "accept");
  622. --- 1655,1661 ----
  623.   #ifdef SOCKS
  624.       s = Raccept(data, (struct sockaddr *) &from, &fromlen);
  625.   #else
  626. !     s = Accept(data, &from, &fromlen);
  627.   #endif
  628.       if (s < 0) {
  629.           PERROR("dataconn", "accept");
  630. diff -c ./ftp.h ../ncftp154/ftp.h
  631. *** ./ftp.h    Thu Sep  2 01:23:01 1993
  632. --- ../ncftp154/ftp.h    Wed Sep 15 18:53:44 1993
  633. ***************
  634. *** 20,29 ****
  635. --- 20,41 ----
  636.   #define pr_dots 4
  637.   #define pr_last pr_dots
  638.   
  639. + /* Values sent to CommandWithFlags() to determine whether to read a reply
  640. +  * from the remote host after sending the command.
  641. +  */
  642. + #define DONT_WAIT_FOR_REPLY 0
  643. + #define WAIT_FOR_REPLY 1
  644. + /* Expect EOF values for getreply() */
  645. + #define DONT_EXPECT_EOF        0
  646. + #define EXPECT_EOF            1
  647.   int hookup(char *, unsigned int);
  648.   int Login(char *userNamePtr, char *passWordPtr, char *accountPtr, int doInit);
  649.   void cmdabort SIG_PARAMS;
  650. + int CommandWithFlags(char *, int);
  651.   int command(char *);
  652. + int command_noreply(char *);
  653.   int quiet_command(char *);
  654.   int verbose_command(char *);
  655.   int getreply(int);
  656. diff -c ./ftprc.c ../ncftp154/ftprc.c
  657. *** ./ftprc.c    Thu Sep  2 01:23:01 1993
  658. --- ../ncftp154/ftprc.c    Wed Sep 15 18:53:44 1993
  659. ***************
  660. *** 383,400 ****
  661.   {
  662.       register siteptr        s, s2;
  663.       register recentsite        *r;
  664. !     char                    *ndir, *nhost;
  665. !     int                        x, i;
  666.   
  667.       ndir = nhost = NULL;
  668.       x = 0;
  669.   
  670. !     /* see if 'host' is in our list of favorite sites (in NETRC). */
  671. !     if ((s = FindNetrcSite(host)) != NULL) {
  672. !         nhost = s->name;
  673. !     } else if ((r = FindRecentSite(host)) != NULL) {
  674. !         nhost = r->name;
  675. !         ndir = r->dir;
  676.       } else if (sscanf(host[0]=='#' ? host+1 : host, "%d", &x) != 1) {
  677.           x = 0;
  678.       }
  679. --- 383,416 ----
  680.   {
  681.       register siteptr        s, s2;
  682.       register recentsite        *r;
  683. !     char                    *ndir, *nhost, *cp;
  684. !     int                        x, i, isAllDigits;
  685.   
  686.       ndir = nhost = NULL;
  687.       x = 0;
  688.   
  689. !     /* Don't allow just numbers as abbreviations;  "open 2" could be
  690. !      * confused between site numbers in the open 'menu,' like
  691. !      * "2. unlinfo.unl.edu" and IP numbers "128.93.2.1" or even numbers
  692. !      * in the site name like "simtel20.army.mil."
  693. !      */
  694. !     
  695. !     for (isAllDigits = 1, cp = host; *cp != 0; cp++) {
  696. !         if (!isdigit(*cp)) {
  697. !             isAllDigits = 0;
  698. !             break;
  699. !         }
  700. !     }
  701. !     if (!isAllDigits) {
  702. !         /* Try matching the abbreviation, since it isn't just a number. */
  703. !         /* see if 'host' is in our list of favorite sites (in NETRC). */
  704. !         if ((s = FindNetrcSite(host)) != NULL) {
  705. !             nhost = s->name;
  706. !         } else if ((r = FindRecentSite(host)) != NULL) {
  707. !             nhost = r->name;
  708. !             ndir = r->dir;
  709. !         }
  710.       } else if (sscanf(host[0]=='#' ? host+1 : host, "%d", &x) != 1) {
  711.           x = 0;
  712.       }
  713. diff -c ./main.c ../ncftp154/main.c
  714. *** ./main.c    Thu Sep  2 01:23:01 1993
  715. --- ../ncftp154/main.c    Wed Sep 15 18:53:46 1993
  716. ***************
  717. *** 7,14 ****
  718.   
  719.   #define _main_c_
  720.   
  721. ! #define FTP_VERSION \
  722. ! "NcFTP 1.5.3 (September 2, 1993) by Mike Gleason, NCEMRSoft."
  723.   
  724.   /* #define BETA 1 */ /* If defined, it prints a little warning message. */
  725.   
  726. --- 7,13 ----
  727.   
  728.   #define _main_c_
  729.   
  730. ! #define FTP_VERSION "1.5.4 (September 14, 1993)"
  731.   
  732.   /* #define BETA 1 */ /* If defined, it prints a little warning message. */
  733.   
  734. ***************
  735. *** 38,43 ****
  736. --- 37,45 ----
  737.   #ifdef CURSES
  738.   #    undef HZ        /* Collides with HaZeltine ! */
  739.   #    include <curses.h>
  740. + #    ifdef TERMH
  741. + #        include <term.h>
  742. + #    endif
  743.   #endif    /* CURSES */
  744.   
  745.   #include "util.h"
  746. ***************
  747. *** 336,346 ****
  748.   #endif
  749.   
  750.   #ifndef CURSES
  751. !         (void) printf("%s%s%s%s\n", 
  752.                   tcap_boldface, FTP_VERSION, BETA_MSG, tcap_normal);
  753.   #else
  754.           string vis;
  755. !         (void) sprintf(vis, "%s%s%s%s\n", 
  756.                   tcap_boldface, FTP_VERSION, BETA_MSG, tcap_normal);
  757.           tcap_put(vis);
  758.   #endif /* !CURSES */
  759. --- 338,348 ----
  760.   #endif
  761.   
  762.   #ifndef CURSES
  763. !         (void) printf("%sNcFTP %s by Mike Gleason, NCEMRSoft.%s%s\n", 
  764.                   tcap_boldface, FTP_VERSION, BETA_MSG, tcap_normal);
  765.   #else
  766.           string vis;
  767. !         (void) sprintf(vis, "%sNcFTP %s by Mike Gleason, NCEMRSoft.%s%s\n", 
  768.                   tcap_boldface, FTP_VERSION, BETA_MSG, tcap_normal);
  769.           tcap_put(vis);
  770.   #endif /* !CURSES */
  771. ***************
  772. *** 976,1001 ****
  773.   
  774.   
  775.   #ifdef CURSES
  776. ! void termcap_get(char **dest, char *attr)
  777.   {
  778.       static char area[1024];
  779.       static char *s = area, *t;
  780. !     char buf[64];
  781. !     int foo;
  782.   
  783. !     t = tgetstr(attr, &s);
  784. !     if (t)
  785.           (void) Strncpy(buf, t);
  786. !     else
  787. !         buf[0] = '\0';
  788.       if (buf[0]) {
  789. !          for (foo = 0; (buf[foo] <= '9') && (buf[foo] >= '0'); foo++); 
  790. !          if ((*dest = (char *)malloc(strlen(&(buf[foo])) + 1)) == NULL) 
  791.                *dest = "";
  792. !          else 
  793. !              (void) strcpy(*dest, &(buf[foo]));
  794. !      } else 
  795.            *dest = "";
  796.   }    /* termcap_get */
  797.   
  798.   
  799. --- 978,1010 ----
  800.   
  801.   
  802.   #ifdef CURSES
  803. ! int termcap_get(char **dest, char *attr)
  804.   {
  805.       static char area[1024];
  806.       static char *s = area, *t;
  807. !     char buf[64], *cp;
  808. !     int i, result = -1;
  809.   
  810. !     buf[0] = 0;
  811. !     if ((t = tgetstr(attr, &s)) != NULL)
  812.           (void) Strncpy(buf, t);
  813.       if (buf[0]) {
  814. !          for (i = 0; (buf[i] <= '9') && (buf[i] >= '0'); )
  815. !             ++i; 
  816. !          if ((*dest = (char *)malloc(strlen(&(buf[i])) + 1)) == NULL) {
  817.                *dest = "";
  818. !          } else {
  819. !              (void) strcpy(*dest, &(buf[i]));
  820. !             /* Get rid of the terminal delays, like "$<2>". */
  821. !             if ((cp = strstr(*dest, "$<")) != NULL)
  822. !                 *cp = 0;
  823. !             result = 0;
  824. !         }
  825. !      } else { 
  826.            *dest = "";
  827. +     }
  828. +     return (result);
  829.   }    /* termcap_get */
  830.   
  831.   
  832. ***************
  833. *** 1013,1022 ****
  834.       if (tgetent(tcbuf,term) != 1) {
  835.           (void) fprintf(stderr,"Can't get termcap entry for terminal [%s]\n", term);
  836.       } else {
  837. !         termcap_get(&tcap_normal, "me");
  838. !         termcap_get(&tcap_boldface, "md");
  839. !         termcap_get(&tcap_underline, "us");
  840. !         termcap_get(&tcap_reverse, "so");
  841.           tcl_normal = strlen(tcap_normal);
  842.           tcl_bold = strlen(tcap_boldface);
  843.           tcl_uline = strlen(tcap_underline);
  844. --- 1022,1034 ----
  845.       if (tgetent(tcbuf,term) != 1) {
  846.           (void) fprintf(stderr,"Can't get termcap entry for terminal [%s]\n", term);
  847.       } else {
  848. !         (void) termcap_get(&tcap_normal, "me");
  849. !         if (termcap_get(&tcap_boldface, "md") < 0) {
  850. !             /* Dim-mode is better than nothing... */
  851. !             (void) termcap_get(&tcap_normal, "mh");
  852. !         }
  853. !         (void) termcap_get(&tcap_underline, "us");
  854. !         (void) termcap_get(&tcap_reverse, "so");
  855.           tcl_normal = strlen(tcap_normal);
  856.           tcl_bold = strlen(tcap_boldface);
  857.           tcl_uline = strlen(tcap_underline);
  858. diff -c ./main.h ../ncftp154/main.h
  859. *** ./main.h    Thu Sep  2 01:23:01 1993
  860. --- ../ncftp154/main.h    Wed Sep 15 18:53:46 1993
  861. ***************
  862. *** 31,45 ****
  863.   int CheckNewMail(void);
  864.   
  865.   #ifdef CURSES
  866. ! void tcap_put(char *cap);
  867. ! void termcap_init(void);
  868. ! void termcap_get(char **dest, char *attr);
  869. ! #ifdef NO_CONST
  870. ! extern char *tgetstr(char *, char **);
  871. ! #else
  872. ! extern char *tgetstr(const char *, char **);
  873. ! #endif
  874.   #endif    /* CURSES */
  875.   /* Should be in a 'tips.h,' but... */
  876.   void PrintTip(void);
  877.   
  878. --- 31,48 ----
  879.   int CheckNewMail(void);
  880.   
  881.   #ifdef CURSES
  882. !     void tcap_put(char *cap);
  883. !     void termcap_init(void);
  884. !     int termcap_get(char **dest, char *attr);
  885. ! #    ifndef TERMH /* <term.h> would take care of this. */
  886. ! #        ifdef NO_CONST
  887. !             extern char *tgetstr(char *, char **);
  888. ! #        else
  889. !             extern char *tgetstr(const char *, char **);
  890. ! #        endif
  891. ! #    endif    /* TERMH */
  892.   #endif    /* CURSES */
  893.   /* Should be in a 'tips.h,' but... */
  894.   void PrintTip(void);
  895.   
  896. diff -c ./open.c ../ncftp154/open.c
  897. *** ./open.c    Thu Sep  2 01:23:01 1993
  898. --- ../ncftp154/open.c    Wed Sep 15 18:53:47 1993
  899. ***************
  900. *** 45,51 ****
  901.   
  902.   /* open.c externs */
  903.   extern char                    *reply_string, *line, *Optarg, *margv[];
  904. ! extern int                    Optind, margc, verbose;
  905.   extern long                    eventnumber;
  906.   extern struct servent        serv;
  907.   extern FILE                    *cout;
  908. --- 45,51 ----
  909.   
  910.   /* open.c externs */
  911.   extern char                    *reply_string, *line, *Optarg, *margv[];
  912. ! extern int                    Optind, margc, verbose, macnum;
  913.   extern long                    eventnumber;
  914.   extern struct servent        serv;
  915.   extern FILE                    *cout;
  916. ***************
  917. *** 115,120 ****
  918. --- 115,121 ----
  919.   int GetOpenOptions(int argc, char **argv, OpenOptions *openopt)
  920.   {
  921.       int                    opt;
  922. +     char                *cp;
  923.   
  924.       /* First setup the openopt variables. */
  925.       InitOpenOptions(openopt);
  926. ***************
  927. *** 225,231 ****
  928.           if (openopt->hostname[0] == 0)
  929.               goto usage;
  930.       } else {
  931. !         /* The user gave us a host to open.  */
  932.           (void) Strncpy(openopt->hostname, argv[Optind]);
  933.       }
  934.       return NOERR;
  935. --- 226,240 ----
  936.           if (openopt->hostname[0] == 0)
  937.               goto usage;
  938.       } else {
  939. !         /* The user gave us a host to open.
  940. !          *
  941. !          * First, check to see if they gave us a colon-mode path
  942. !          * along with the hostname.
  943. !          */
  944. !         if ((cp = index(argv[Optind], ':')) != NULL) {
  945. !             *cp++ = 0;
  946. !             (void) Strncpy(openopt->colonmodepath, cp);
  947. !         }    
  948.           (void) Strncpy(openopt->hostname, argv[Optind]);
  949.       }
  950.       return NOERR;
  951. ***************
  952. *** 242,249 ****
  953.    */
  954.   int CheckForColonMode(OpenOptions *openopt, int *login_verbosity)
  955.   {
  956. -     char *path;
  957.       /* Usually the user doesn't supply hostname in colon-mode format,
  958.        * and wants to interactively browse the remote host, so set the
  959.        * login_verbosity to whatever it is set to now.
  960. --- 251,256 ----
  961. ***************
  962. *** 250,259 ****
  963.        */
  964.       *login_verbosity = verbose;
  965.   
  966. !     if ((path = index(openopt->hostname, ':')) != NULL) {
  967. !         *path++ = 0;
  968. !         (void) Strncpy(openopt->colonmodepath, path);
  969. !         
  970.           /* But if the user does use colon-mode, we want to do our business
  971.            * and leave, without all the login messages, etc., so set
  972.            * login_verbosity to quiet so we won't print anything until
  973. --- 257,263 ----
  974.        */
  975.       *login_verbosity = verbose;
  976.   
  977. !     if (openopt->colonmodepath[0] != 0) {
  978.           /* But if the user does use colon-mode, we want to do our business
  979.            * and leave, without all the login messages, etc., so set
  980.            * login_verbosity to quiet so we won't print anything until
  981. ***************
  982. *** 296,302 ****
  983.   
  984.   
  985.   
  986. ! void CheckRemoteSystemType(OpenOptions *openopt)
  987.   {
  988.       int tmpverbose;
  989.       char *cp, c;
  990. --- 300,306 ----
  991.   
  992.   
  993.   
  994. ! void CheckRemoteSystemType(int force_binary)
  995.   {
  996.       int tmpverbose;
  997.       char *cp, c;
  998. ***************
  999. *** 328,346 ****
  1000.                   *cp = c;
  1001.           }
  1002.           remote_is_unix = !strncmp(reply_string + 4, "UNIX", (size_t) 4);
  1003. -         if (!remote_is_unix) 
  1004. -             (void) printf("\n\
  1005. - WARNING:  Due to a bug in the program, ncftp may hang while connected to\n\
  1006. - a non-UNIX system.  You probably should use the regular 'ftp' program\n\
  1007. - for those sites until this is fixed.\n\n");
  1008.       }
  1009.   
  1010.       /* Set to binary mode if any of the following are true:
  1011.        * (a) The user has auto-binary set;
  1012. !      * (b) The user is using colon-mode;
  1013.        * (c) The reply-string from SYST said it was UNIX with 8-bit chars.
  1014.        */
  1015. !     if (auto_binary || openopt->colonmodepath[0]
  1016.           || !strncmp(reply_string, "215 UNIX Type: L8", (size_t) 17)) {
  1017.           (void) _settype("binary");
  1018.           if (tmpverbose > V_TERSE)
  1019. --- 332,345 ----
  1020.                   *cp = c;
  1021.           }
  1022.           remote_is_unix = !strncmp(reply_string + 4, "UNIX", (size_t) 4);
  1023.       }
  1024.   
  1025.       /* Set to binary mode if any of the following are true:
  1026.        * (a) The user has auto-binary set;
  1027. !      * (b) The user is using colon-mode (force_binary);
  1028.        * (c) The reply-string from SYST said it was UNIX with 8-bit chars.
  1029.        */
  1030. !     if (auto_binary || force_binary
  1031.           || !strncmp(reply_string, "215 UNIX Type: L8", (size_t) 17)) {
  1032.           (void) _settype("binary");
  1033.           if (tmpverbose > V_TERSE)
  1034. ***************
  1035. *** 350,357 ****
  1036.       /* Print a warning for that (extremely) rare Tenex machine. */
  1037.       if (tmpverbose >= V_ERRS && 
  1038.           !strncmp(reply_string, "215 TOPS20", (size_t) 10)) {
  1039. !         (void) printf(
  1040. ! "Remember to set tenex mode when transfering _binary_ files from this machine.\n");
  1041.       }
  1042.       verbose = tmpverbose;
  1043.   }    /* CheckRemoteSystemType */
  1044. --- 349,356 ----
  1045.       /* Print a warning for that (extremely) rare Tenex machine. */
  1046.       if (tmpverbose >= V_ERRS && 
  1047.           !strncmp(reply_string, "215 TOPS20", (size_t) 10)) {
  1048. !         (void) _settype("tenex");
  1049. !         (void) printf("Using tenex mode to transfer files.\n");
  1050.       }
  1051.       verbose = tmpverbose;
  1052.   }    /* CheckRemoteSystemType */
  1053. ***************
  1054. *** 441,446 ****
  1055. --- 440,447 ----
  1056.       char *user, *pass, *acct;    
  1057.       int                    login_verbosity;
  1058.   
  1059. +     macnum = 0;     /* Reset macros. */
  1060.       /* If the hostname supplied is in the form host.name.str:/path/file,
  1061.        * then colon mode was used, and we need to fix the hostname to be
  1062.        * just the hostname, copy the /path/file to colonmode path, and init
  1063. ***************
  1064. *** 521,531 ****
  1065.               }
  1066.   #endif
  1067.   
  1068. -             /* We need to check for unix and see if we should set binary
  1069. -              * mode automatically.
  1070. -              */
  1071. -             CheckRemoteSystemType(openopt);
  1072.   #ifdef GATEWAY
  1073.               if (!*gateway) {
  1074.   #endif
  1075. --- 522,527 ----
  1076. ***************
  1077. *** 542,547 ****
  1078. --- 538,548 ----
  1079.   #ifdef GATEWAY
  1080.               }
  1081.   #endif
  1082. +             /* We need to check for unix and see if we should set binary
  1083. +              * mode automatically.
  1084. +              */
  1085. +             CheckRemoteSystemType(openopt->colonmodepath[0] != (char)0);
  1086.   
  1087.               if (openopt->colonmodepath[0]) {
  1088.                   ColonMode(openopt);
  1089. diff -c ./open.h ../ncftp154/open.h
  1090. *** ./open.h    Thu Sep  2 01:23:01 1993
  1091. --- ../ncftp154/open.h    Wed Sep 15 18:53:47 1993
  1092. ***************
  1093. *** 37,43 ****
  1094.   int GetOpenOptions(int argc, char **argv, OpenOptions *openopt);
  1095.   int CheckForColonMode(OpenOptions *openopt, int *login_verbosity);
  1096.   int HookupToRemote(OpenOptions *openopt);
  1097. ! void CheckRemoteSystemType(OpenOptions *openopt);
  1098.   void ColonMode(OpenOptions *openopt);
  1099.   int Open(OpenOptions *openopt);
  1100.   int cmdOpen(int argc, char **argv);
  1101. --- 37,43 ----
  1102.   int GetOpenOptions(int argc, char **argv, OpenOptions *openopt);
  1103.   int CheckForColonMode(OpenOptions *openopt, int *login_verbosity);
  1104.   int HookupToRemote(OpenOptions *openopt);
  1105. ! void CheckRemoteSystemType(int);
  1106.   void ColonMode(OpenOptions *openopt);
  1107.   int Open(OpenOptions *openopt);
  1108.   int cmdOpen(int argc, char **argv);
  1109. diff -c ./patchlevel.h ../ncftp154/patchlevel.h
  1110. *** ./patchlevel.h    Thu Sep  2 01:23:01 1993
  1111. --- ../ncftp154/patchlevel.h    Wed Sep 15 18:53:48 1993
  1112. ***************
  1113. *** 125,129 ****
  1114.    *  sitenames weren't expanded.  Fixed a tip.  Using <readline/readline.h>
  1115.    *  and <getline/getline.h> instead of <readline.h> etc.  Fixed daylight
  1116.    *  savings time bug.  LocalPath checks $HOME now.
  1117.    */
  1118. --- 125,147 ----
  1119.    *  sitenames weren't expanded.  Fixed a tip.  Using <readline/readline.h>
  1120.    *  and <getline/getline.h> instead of <readline.h> etc.  Fixed daylight
  1121.    *  savings time bug.  LocalPath checks $HOME now.
  1122. +  *
  1123. +  * v1.5.4 - September 14, 1993.
  1124. +  *  Fixed bug where non-unix sites were hanging after listings.  Better
  1125. +  *  SVR4 support.  Fixed bug during an ascii transfer with debug mode
  1126. +  *  on.  Now checking the system type after a successful login, because
  1127. +  *  some sites didn't allow commands to be executed until logged in; this
  1128. +  *  prevents one (the only?) instance of the elusive short-file bug, because
  1129. +  *  files were being fetched with ascii mode on.  Now checking for half-
  1130. +  *  bright mode if boldface isn't available.  Numeric-only site abbreviations
  1131. +  *  no longer accepted, so numbers will be treated only as indices from the
  1132. +  *  open 'menu.'  You can include <term.h> for the 'tgetstr' prototype,
  1133. +  *  if you define TERMH.  termcap_get() tweaked.  Fixed bug where macros
  1134. +  *  from the previous site were still present when you opened a new site.
  1135. +  *  Fixed bug where colon-mode paths were truncated.  Setting tenex mode
  1136. +  *  automatically when you open a TOPS20 site.  Looking for <getline.h>
  1137. +  *  instead of <getline/getline.h>; have to leave <readline/readline.h>,
  1138. +  *  because that header also includes stuff like <readline/keymaps.h>.
  1139. +  *  Catman support added to Makefile.  Fixed problem with terminfo, where
  1140. +  *  $<2> etc., was not being removed from the terminal control strings.
  1141.    */
  1142. diff -c ./sys.h ../ncftp154/sys.h
  1143. *** ./sys.h    Thu Sep  2 01:23:01 1993
  1144. --- ../ncftp154/sys.h    Wed Sep 15 18:53:48 1993
  1145. ***************
  1146. *** 7,12 ****
  1147. --- 7,28 ----
  1148.    *  $Date: 93/06/21 06:42:11 $
  1149.    */
  1150.   
  1151. + #ifdef SVR4
  1152. + #    define System "System V.4"
  1153. + #    ifndef SYSV
  1154. + #        define SYSV 1
  1155. + #    endif
  1156. + #    define VOID void
  1157. + #    ifndef HERROR
  1158. + #        define HERROR 1
  1159. + #    endif
  1160. + #    ifdef TERMH
  1161. + #        define TERMH 1
  1162. + #    endif
  1163. + #    define Gettimeofday gettimeofday
  1164. + #    include <sys/types.h>
  1165. + #endif  /* SVR4 */
  1166.   #ifdef __sun
  1167.   #    ifndef sun
  1168.   #        define sun 1
  1169. ***************
  1170. *** 49,54 ****
  1171. --- 65,73 ----
  1172.   #    ifndef STRICT_PROTOS
  1173.   #        define STRICT_PROTOS 1
  1174.   #    endif
  1175. + #    ifndef TERMIOS
  1176. + #        define TERMIOS 1
  1177. + #    endif
  1178.   #endif /* sgi */
  1179.   
  1180.   #ifdef _AIX
  1181. ***************
  1182. *** 283,288 ****
  1183. --- 302,323 ----
  1184.   #ifndef Select
  1185.   #    define Select(a,b,c,d,e) select((a), (b), (c), (d), (e))
  1186.   #endif
  1187. + #ifndef Connect
  1188. + #ifndef SVR4
  1189. + #    define Connect(a,b,c) (connect((a), (struct sockaddr *)(b), (int)(c)))
  1190. + #    define Bind(a,b,c) (bind((a), (struct sockaddr *)(b), (int)(c)))
  1191. + #    define Accept(a,b,c) (accept((a), (struct sockaddr *)(b), (int *)(c)))
  1192. + #else  /* SVR4 */
  1193. + #    define Connect(a,b,c) (connect((a), (addr_t)(b), (int)(c)))
  1194. + #    define Bind(a,b,c) (bind((a), (caddr_t)(b), (int)(c)))
  1195. + #    define Accept(a,b,c) (accept((a), (caddr_t)(b), (int *)(c)))
  1196. + #endif    /* SVR4 */
  1197. + #endif    /* Connect */
  1198. + #ifndef Gettimeofday
  1199. + #    define Gettimeofday(a) gettimeofday(a, (struct timezone *)0)
  1200. + #endif /* Gettimeofday */
  1201.   
  1202.   #ifdef GETPASS
  1203.   #    define Getpass getpass
  1204. diff -c ./util.c ../ncftp154/util.c
  1205. *** ./util.c    Thu Sep  2 01:23:01 1993
  1206. --- ../ncftp154/util.c    Wed Sep 15 18:53:49 1993
  1207. ***************
  1208. *** 27,33 ****
  1209.   #endif /* READLINE */
  1210.   
  1211.   #ifdef GETLINE
  1212. ! #    include <getline/getline.h>
  1213.   #endif
  1214.   
  1215.   #include "util.h"
  1216. --- 27,33 ----
  1217.   #endif /* READLINE */
  1218.   
  1219.   #ifdef GETLINE
  1220. ! #    include <getline.h>
  1221.   #endif
  1222.   
  1223.   #include "util.h"
  1224. --
  1225. --mg                                                      mgleason@cse.unl.edu
  1226.  
  1227. exit 0 # Just in case...
  1228.