home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume39 / ncftp / patch01 < prev    next >
Encoding:
Text File  |  1993-08-30  |  32.6 KB  |  1,140 lines

  1. Newsgroups: comp.sources.misc
  2. From: mgleason@cse.unl.edu (Mike Gleason)
  3. Subject: v39i065:  ncftp - Alternative User Interface for FTP, v1.5.0, Patch01
  4. Message-ID: <1993Aug30.114552.21082@sparky.sterling.com>
  5. X-Md4-Signature: 7752353c385694f848fa6d4590ff6e22
  6. Sender: kent@sparky.sterling.com (Kent Landfield)
  7. Organization: NCEMRSoft
  8. Date: Mon, 30 Aug 1993 11:45:52 GMT
  9. Approved: kent@sparky.sterling.com
  10.  
  11. Submitted-by: mgleason@cse.unl.edu (Mike Gleason)
  12. Posting-number: Volume 39, Issue 65
  13. Archive-name: ncftp/patch01
  14. Environment: UNIX, ANSI-C, !SVR4
  15. Patch-To: ncftp: Volume 39, Issue 53-57
  16.  
  17. This is the first official patch to ncftp 1.5, posted last week.  This
  18. patch fixes some bugs and adds a little portability.
  19.  
  20. I will put up the fully-patched version up for ftp sometime after Sept. 5.
  21.  
  22. /* v1.5.1 - August 29, 1993
  23.  *  Bugs fixed in termcap code, mput, and pwd.  No longer adding blank
  24.  *  lines to readline's history.  Netrc site abbreviations were matched
  25.  *  by strncmp() when it should have been strstr().  Bug fixed in
  26.  *  open's site "menu."  Revised tips a little to encourage .ncftprc instead
  27.  *  of .netrc.  TRY_ABOR documented in the README.  Added stuff to the
  28.  *  DYNIX entry.  Hacks added for SCO322.  Shortened bargraph prog meter
  29.  *  by one char.  Better compat with getline.  Man page fixed by DWS again :)
  30.  */
  31.  
  32. diff -c ./README ../ncftp151/README
  33. *** ./README    Tue Aug 24 16:33:43 1993
  34. --- ../ncftp151/README    Sun Aug 29 21:47:35 1993
  35. ***************
  36. *** 99,105 ****
  37.         set CFLAGS= -Aa.  You may also need to use gcc if your
  38.         compiler is non-ANSI.
  39.   
  40. !     SCO Unix:  Add -DSCO324 to SDEFS, and -lsocket to LIBS.
  41.   
  42.       Bull DPX/2: Add -DBULL to SDEFS, add -linet to LIBS, and
  43.         use gcc.
  44. --- 99,106 ----
  45.         set CFLAGS= -Aa.  You may also need to use gcc if your
  46.         compiler is non-ANSI.
  47.   
  48. !     SCO Unix:  Add -DSCO324 or -DSCO322 (as appropriate) to SDEFS,
  49. !       and -lsocket to LIBS.
  50.   
  51.       Bull DPX/2: Add -DBULL to SDEFS, add -linet to LIBS, and
  52.         use gcc.
  53. ***************
  54. *** 106,112 ****
  55.   
  56.       Sequent's DYNIX: Use gcc and add -DDYNIX (if necessary) to SDEFS.
  57.         You may also be short several string functions which you will
  58. !       have to get elsewhere.
  59.   
  60.   If your system doesn't fit any of those, things will be trickier.  Answer
  61.   all these questions and add to the SDEFS line.  You may want to try
  62. --- 107,115 ----
  63.   
  64.       Sequent's DYNIX: Use gcc and add -DDYNIX (if necessary) to SDEFS.
  65.         You may also be short several string functions which you will
  66. !       have to get elsewhere, and perhaps mktime and strftime.
  67. !       You can get all that stuff from the BSD sources (like ftp.uu.net).
  68. !       Please bug Sequent to update their libc library!
  69.   
  70.   If your system doesn't fit any of those, things will be trickier.  Answer
  71.   all these questions and add to the SDEFS line.  You may want to try
  72. ***************
  73. *** 204,209 ****
  74. --- 207,216 ----
  75.       with -DSOCKS added to PDEFS, and the pathname of the Rconnect.o file
  76.       added to LIBS.
  77.       
  78. + *    -DTRY_ABOR:  Define if you want to try the 'ABOR' command from ncftp;
  79. +     The aborting code has had some problems, so by default the program
  80. +     'aborts' by continuing to read input but not echoing output.
  81.   *   -DDB_ERRS:  Define this if you want my Perror() function to be more
  82.       verbose.  You may want to do this if you are a programmer examining this
  83.       code, and want to know where in the source the Perror's are coming
  84. diff -c ./cmds.c ../ncftp151/cmds.c
  85. *** ./cmds.c    Tue Aug 24 16:33:42 1993
  86. --- ../ncftp151/cmds.c    Sun Aug 29 21:47:35 1993
  87. ***************
  88. *** 315,322 ****
  89.       (void) setjmp(jabort);
  90.       for (i = 1; i < argc; i++) {
  91.           register char **cpp, **gargs;
  92. !         gargs = glob(argv[i]);
  93.           if (globerr != NULL) {
  94.               (void) printf("%s\n", globerr);
  95.               if (gargs) {
  96. --- 315,330 ----
  97.       (void) setjmp(jabort);
  98.       for (i = 1; i < argc; i++) {
  99.           register char **cpp, **gargs;
  100. !         char *icopy;
  101. !         
  102. !         /* Make a copy of the argument, because glob() will just copy
  103. !          * the pointer you give it to the glob-arg vector, and blkfree()
  104. !          * will want to free each element of the glob-arg vector
  105. !          * later.
  106. !          */
  107. !         if ((icopy = NewString(argv[i])) == NULL)
  108. !             break;
  109. !         gargs = glob(icopy);
  110.           if (globerr != NULL) {
  111.               (void) printf("%s\n", globerr);
  112.               if (gargs) {
  113. ***************
  114. *** 1039,1045 ****
  115.   /*ARGSUSED*/
  116.   int pwd(int argc, char **argv)
  117.   {
  118. !     (void) quiet_command("PWD");
  119.       return NOERR;
  120.   }    /* pwd */
  121.   
  122. --- 1047,1053 ----
  123.   /*ARGSUSED*/
  124.   int pwd(int argc, char **argv)
  125.   {
  126. !     (void) verbose_command("PWD");
  127.       return NOERR;
  128.   }    /* pwd */
  129.   
  130. ***************
  131. *** 1799,1804 ****
  132. --- 1807,1815 ----
  133.   #endif
  134.   #ifdef NO_VARARGS 
  135.       DStrs[nDStrs++] = "NO_VARARGS";
  136. + #endif
  137. + #ifdef TRY_ABOR
  138. +     DStrs[nDStrs++] = "TRY_ABOR";
  139.   #endif
  140.   #ifdef GATEWAY
  141.       DStrs[nDStrs++] = "GATEWAY";
  142. diff -c ./ftp.c ../ncftp151/ftp.c
  143. *** ./ftp.c    Tue Aug 24 16:33:42 1993
  144. --- ../ncftp151/ftp.c    Sun Aug 29 21:47:36 1993
  145. ***************
  146. *** 649,655 ****
  147.                   local,
  148.                   tcap_normal
  149.               );
  150. !             barlen = 64;
  151.               for (s = file_size; s > 0; s /= 10L) barlen--;
  152.               (void) sprintf(spec, "      0 %%%ds %%ld bytes.\r", barlen);
  153.               (void) printf(spec, " ", file_size);
  154. --- 649,655 ----
  155.                   local,
  156.                   tcap_normal
  157.               );
  158. !             barlen = 63;
  159.               for (s = file_size; s > 0; s /= 10L) barlen--;
  160.               (void) sprintf(spec, "      0 %%%ds %%ld bytes.\r", barlen);
  161.               (void) printf(spec, " ", file_size);
  162. ***************
  163. *** 1001,1007 ****
  164.       activemcmd = 0;
  165.       abrtflag = 0;
  166.       (void) fprintf(stderr, 
  167. ! #ifdef TryAbort
  168.       "(abort)\n");
  169.   #else
  170.       "\nAborting, please wait...");
  171. --- 1001,1007 ----
  172.       activemcmd = 0;
  173.       abrtflag = 0;
  174.       (void) fprintf(stderr, 
  175. ! #ifdef TRY_ABOR
  176.       "(abort)\n");
  177.   #else
  178.       "\nAborting, please wait...");
  179. ***************
  180. *** 1414,1420 ****
  181.           do_reports = start_progress(0, local);
  182.   
  183.       if (setjmp(recvabort)) {
  184. ! #ifdef TryAbort
  185.           goto Abort;
  186.   #else
  187.           /* Just read the rest of the stream without doing anything with
  188. --- 1414,1420 ----
  189.           do_reports = start_progress(0, local);
  190.   
  191.       if (setjmp(recvabort)) {
  192. ! #ifdef TRY_ABOR
  193.           goto Abort;
  194.   #else
  195.           /* Just read the rest of the stream without doing anything with
  196. diff -c ./ftprc.c ../ncftp151/ftprc.c
  197. *** ./ftprc.c    Tue Aug 24 16:33:43 1993
  198. --- ../ncftp151/ftprc.c    Sun Aug 29 21:47:37 1993
  199. ***************
  200. *** 450,456 ****
  201.                       cp++;
  202.               } else
  203.                   continue;
  204. !             if (strncmp(cp, host, strlen(host)) == 0) {
  205.                   site_found = 1;
  206.                   while (!isspace(*cp))
  207.                       ++cp;        /* skip the site name. */
  208. --- 450,456 ----
  209.                       cp++;
  210.               } else
  211.                   continue;
  212. !             if (strstr(host, str) != NULL) {
  213.                   site_found = 1;
  214.                   while (!isspace(*cp))
  215.                       ++cp;        /* skip the site name. */
  216. diff -c ./getpass.c ../ncftp151/getpass.c
  217. *** ./getpass.c    Tue Aug 24 16:33:43 1993
  218. --- ../ncftp151/getpass.c    Sun Aug 29 21:47:38 1993
  219. ***************
  220. *** 125,134 ****
  221.        * read and write to /dev/tty if possible; else read from
  222.        * stdin and write to stderr.
  223.        */
  224. !     if ((outfp = fp = fopen("/dev/tty", "w+")) == NULL) {
  225. !         outfp = stderr;
  226.           fp = stdin;
  227. !     }
  228.       oldintr = Signal(SIGINT, SIG_IGN);
  229.       echo(fp, 0);        /* Turn echoing off. */
  230.       (void) fputs(promptstr, outfp);
  231. --- 125,142 ----
  232.        * read and write to /dev/tty if possible; else read from
  233.        * stdin and write to stderr.
  234.        */
  235. ! #if !defined(BOTCHED_FOPEN_RW)
  236. !       if ((outfp = fp = fopen("/dev/tty", "w+")) == NULL) {
  237. !           outfp = stderr;
  238. !           fp = stdin;
  239. !       }
  240. ! #else
  241. !     /* SCO 32v2 botches "w+" open */
  242. !     if ((fp = fopen("/dev/tty", "r")) == NULL)
  243.           fp = stdin;
  244. !     if ((outfp = fopen("/dev/tty", "w")) == NULL)
  245. !         outfp = stderr;
  246. ! #endif
  247.       oldintr = Signal(SIGINT, SIG_IGN);
  248.       echo(fp, 0);        /* Turn echoing off. */
  249.       (void) fputs(promptstr, outfp);
  250. ***************
  251. *** 142,147 ****
  252. --- 150,159 ----
  253.       (void) Signal(SIGINT, oldintr);
  254.       if (fp != stdin)
  255.           (void)fclose(fp);
  256. + #if defined(BOTCHED_FOPEN_RW)
  257. +     if (outfp != stderr)
  258. +         (void)fclose(outfp);
  259. + #endif
  260.       return(buf);
  261.   }    /* Getpass */
  262.   
  263. diff -c ./main.c ../ncftp151/main.c
  264. *** ./main.c    Tue Aug 24 16:33:43 1993
  265. --- ../ncftp151/main.c    Sun Aug 29 21:47:39 1993
  266. ***************
  267. *** 8,14 ****
  268.   #define _main_c_
  269.   
  270.   #define FTP_VERSION \
  271. ! "NcFTP 1.5.0 (Aug 22, 1993) by Mike Gleason, NCEMRSoft."
  272.   
  273.   /* #define BETA 1 */ /* If defined, it prints a little warning message. */
  274.   
  275. --- 8,14 ----
  276.   #define _main_c_
  277.   
  278.   #define FTP_VERSION \
  279. ! "NcFTP 1.5.1 (Aug 29, 1993) by Mike Gleason, NCEMRSoft."
  280.   
  281.   /* #define BETA 1 */ /* If defined, it prints a little warning message. */
  282.   
  283. ***************
  284. *** 85,94 ****
  285.                                            * prompt as it will appear on screen,
  286.                                            * (i.e. no invis escape codes).
  287.                                            */
  288. ! char                *tcap_normal = "\033[0m";    /* Default ANSI escapes */
  289. ! char                *tcap_boldface = "\033[1m";
  290. ! char                *tcap_underline = "\033[4m";
  291. ! char                *tcap_reverse = "\033[7m";
  292.   size_t                tcl_normal = 4,        /* lengths of the above strings. */
  293.                       tcl_bold = 4,
  294.                       tcl_uline = 4,
  295. --- 85,106 ----
  296.                                            * prompt as it will appear on screen,
  297.                                            * (i.e. no invis escape codes).
  298.                                            */
  299. ! #ifdef HPUX
  300. ! char                *tcap_normal = "\033&d@";    /* Default ANSI escapes */
  301. ! char                *tcap_boldface = "\033&dH";     /* Half Bright */
  302. ! char                *tcap_underline = "\033&dD";
  303. ! char                *tcap_reverse = "\033&dB";
  304. ! #else
  305. ! char                            *tcap_normal = "\033[0m";       /* Default ANSI escapes */
  306. ! char                            *tcap_boldface = "\033[1m";
  307. ! char                            *tcap_underline = "\033[4m";
  308. ! char                            *tcap_reverse = "\033[7m";
  309. ! #endif
  310.   size_t                tcl_normal = 4,        /* lengths of the above strings. */
  311.                       tcl_bold = 4,
  312.                       tcl_uline = 4,
  313. ***************
  314. *** 964,985 ****
  315.   
  316.   
  317.   #ifdef CURSES
  318. ! void termcap_get(char *dest, char *attr)
  319.   {
  320.       static char area[1024];
  321.       static char *s = area;
  322. !     char buf[32];
  323.       int foo;
  324.   
  325.       (void) Strncpy(buf, tgetstr(attr, &s));
  326.       if (buf[0]) {
  327.            for (foo = 0; (buf[foo] <= '9') && (buf[foo] >= '0'); foo++); 
  328. !          if ((dest = (char *)malloc(strlen(&(buf[foo])) + 1)) == NULL) 
  329. !              *dest = 0;
  330.            else 
  331. !              (void) strcpy(dest, &(buf[foo]));
  332.        } else 
  333. !          *dest = 0;
  334.   }    /* termcap_get */
  335.   
  336.   
  337. --- 976,997 ----
  338.   
  339.   
  340.   #ifdef CURSES
  341. ! void termcap_get(char **dest, char *attr)
  342.   {
  343.       static char area[1024];
  344.       static char *s = area;
  345. !     char buf[64];
  346.       int foo;
  347.   
  348.       (void) Strncpy(buf, tgetstr(attr, &s));
  349.       if (buf[0]) {
  350.            for (foo = 0; (buf[foo] <= '9') && (buf[foo] >= '0'); foo++); 
  351. !          if ((*dest = (char *)malloc(strlen(&(buf[foo])) + 1)) == NULL) 
  352. !              **dest = 0;
  353.            else 
  354. !              (void) strcpy(*dest, &(buf[foo]));
  355.        } else 
  356. !          **dest = 0;
  357.   }    /* termcap_get */
  358.   
  359.   
  360. ***************
  361. *** 997,1011 ****
  362.       if (tgetent(tcbuf,term) != 1) {
  363.           (void) fprintf(stderr,"Can't get termcap entry for terminal [%s]\n", term);
  364.       } else {
  365. !         termcap_get(tcap_normal, "me");
  366. !         termcap_get(tcap_boldface, "md");
  367. !         termcap_get(tcap_underline, "us");
  368. !         termcap_get(tcap_reverse, "so");
  369.           tcl_normal = strlen(tcap_normal);
  370.           tcl_bold = strlen(tcap_boldface);
  371.           tcl_uline = strlen(tcap_underline);
  372.           tcl_rev = strlen(tcap_reverse);
  373.       }
  374.   }    /* termcap_init */
  375.   
  376.   
  377. --- 1009,1024 ----
  378.       if (tgetent(tcbuf,term) != 1) {
  379.           (void) fprintf(stderr,"Can't get termcap entry for terminal [%s]\n", term);
  380.       } else {
  381. !         termcap_get(&tcap_normal, "se");
  382. !         termcap_get(&tcap_boldface, "md");
  383. !         termcap_get(&tcap_underline, "us");
  384. !         termcap_get(&tcap_reverse, "so");
  385.           tcl_normal = strlen(tcap_normal);
  386.           tcl_bold = strlen(tcap_boldface);
  387.           tcl_uline = strlen(tcap_underline);
  388.           tcl_rev = strlen(tcap_reverse);
  389.       }
  390.   }    /* termcap_init */
  391.   
  392.   
  393. ***************
  394. *** 1026,1028 ****
  395. --- 1039,1042 ----
  396.   #endif /* CURSES */
  397.   
  398.   /* eof main.c */
  399. diff -c ./main.h ../ncftp151/main.h
  400. *** ./main.h    Tue Aug 24 16:33:43 1993
  401. --- ../ncftp151/main.h    Sun Aug 29 21:47:39 1993
  402. ***************
  403. *** 33,39 ****
  404.   #ifdef CURSES
  405.   void tcap_put(char *cap);
  406.   void termcap_init(void);
  407. ! void termcap_get(char *dest, char *attr);
  408.   #ifdef NO_CONST
  409.   extern char *tgetstr(char *, char **);
  410.   #else
  411. --- 33,39 ----
  412.   #ifdef CURSES
  413.   void tcap_put(char *cap);
  414.   void termcap_init(void);
  415. ! void termcap_get(char **dest, char *attr);
  416.   #ifdef NO_CONST
  417.   extern char *tgetstr(char *, char **);
  418.   #else
  419. diff -c ./ncftp.1 ../ncftp151/ncftp.1
  420. *** ./ncftp.1    Tue Aug 24 16:33:43 1993
  421. --- ../ncftp151/ncftp.1    Sun Aug 29 21:47:39 1993
  422. ***************
  423. *** 148,154 ****
  424.   names to be abbreviated.
  425.   .PP
  426.   For each commonly accessed site, you can put an entry in your program
  427. ! preferences file (let's call it the ``ncftprc file.''or ``RC file.''for short).
  428.   To open the site, from the command shell all you do is type:
  429.   .Ds
  430.   open wuarchive.wustl.edu
  431. --- 148,154 ----
  432.   names to be abbreviated.
  433.   .PP
  434.   For each commonly accessed site, you can put an entry in your program
  435. ! preferences file (let's call it the ``ncftprc file'' or ``RC file'' for short).
  436.   To open the site, from the command shell all you do is type:
  437.   .Ds
  438.   open wuarchive.wustl.edu
  439. ***************
  440. *** 226,232 ****
  441.   Login Name (mgleason):
  442.   .De
  443.   .PP
  444. ! I could just hit return to tell the program that I want ``mgleason.''as my
  445.   username, then I would enter my password.
  446.   .\"-------
  447.   .SH "Format of the RC file"
  448. --- 226,232 ----
  449.   Login Name (mgleason):
  450.   .De
  451.   .PP
  452. ! I could just hit return to tell the program that I want ``mgleason'' as my
  453.   username, then I would enter my password.
  454.   .\"-------
  455.   .SH "Format of the RC file"
  456. ***************
  457. *** 240,249 ****
  458.   use a new format, so don't invest too much time in it.
  459.   .PP
  460.   The RC file can be named
  461. ! .RB `` ncftprc ,''
  462. ! .RB `` netrc ,''
  463.   or
  464. ! .RB `` .ncftprc ,''
  465.   but it is usually named
  466.   .RB `` .netrc ''
  467.   so it can be used with the stock
  468. --- 240,249 ----
  469.   use a new format, so don't invest too much time in it.
  470.   .PP
  471.   The RC file can be named
  472. ! .RB `` ncftprc '',
  473. ! .RB `` netrc '',
  474.   or
  475. ! .RB `` .ncftprc '',
  476.   but it is usually named
  477.   .RB `` .netrc ''
  478.   so it can be used with the stock
  479. ***************
  480. *** 260,266 ****
  481.   .I #unset
  482.   commands that do things
  483.   to the programs variables.
  484. ! The reason for the ``#.''is so the stock
  485.   .I ftp
  486.   program will think they are comments.
  487.   You might have this appearing as
  488. --- 260,266 ----
  489.   .I #unset
  490.   commands that do things
  491.   to the programs variables.
  492. ! The reason for the ``#'' is so the stock
  493.   .I ftp
  494.   program will think they are comments.
  495.   You might have this appearing as
  496. ***************
  497. *** 315,321 ****
  498.   .De
  499.   .PP
  500.   Of course, if all you want to do is open wuarchive anonymously, you
  501. ! needn't bother with the ``user,.''``password,.''and ``account.''lines.
  502.   You may want to put them in if you plan on using the stock
  503.   .I ftp
  504.   program, though.
  505. --- 315,321 ----
  506.   .De
  507.   .PP
  508.   Of course, if all you want to do is open wuarchive anonymously, you
  509. ! needn't bother with the ``user'', ``password'', and ``account'' lines.
  510.   You may want to put them in if you plan on using the stock
  511.   .I ftp
  512.   program, though.
  513. ***************
  514. *** 480,493 ****
  515.   csh> head README
  516.   .De
  517.   .PP
  518. ! This tells your shell, in this case the ``c-shell.''to run
  519.   .IR NcFTP ,
  520.   which
  521.   would open wuarchive, fetch
  522. ! .B /pub/README
  523.   and write the file
  524.   .B ./README
  525. ! in the your current working directory, and then exits.
  526.   This is nice if you don't
  527.   want to browse around the remote site, and you know exactly want you want.
  528.   It would also come in handy in shell scripts, where you don't want to
  529. --- 480,493 ----
  530.   csh> head README
  531.   .De
  532.   .PP
  533. ! This tells your shell, in this case the ``c-shell'' to run
  534.   .IR NcFTP ,
  535.   which
  536.   would open wuarchive, fetch
  537. ! .B /graphics/gif/README
  538.   and write the file
  539.   .B ./README
  540. ! in the current working directory, and then exits.
  541.   This is nice if you don't
  542.   want to browse around the remote site, and you know exactly want you want.
  543.   It would also come in handy in shell scripts, where you don't want to
  544. ***************
  545. *** 635,641 ****
  546.   empty string.
  547.   .PP
  548.   You can use any of those three commands in both the command shell,
  549. ! or in the RC file with a ``#.''prepended.
  550.   .\"-------
  551.   .SH "Program variables"
  552.   .\"-------
  553. --- 635,641 ----
  554.   empty string.
  555.   .PP
  556.   You can use any of those three commands in both the command shell,
  557. ! or in the RC file with a ``#'' prepended.
  558.   .\"-------
  559.   .SH "Program variables"
  560.   .\"-------
  561. ***************
  562. *** 649,655 ****
  563.   (you can also use
  564.   .RB `` 1 ''
  565.   or
  566. ! .RB `` 0 .''.
  567.   .TP
  568.   Integer:
  569.   Can be any positive or negative number, or
  570. --- 649,655 ----
  571.   (you can also use
  572.   .RB `` 1 ''
  573.   or
  574. ! .RB `` 0 '').
  575.   .TP
  576.   Integer:
  577.   Can be any positive or negative number, or
  578. ***************
  579. *** 753,759 ****
  580.   such as
  581.   .RB `` binary ''
  582.   or
  583. ! .RB `` ascii .''
  584.   .TP
  585.   .IR verbose " (String/Integer)"
  586.   Controls the amount of output spewed by the program.
  587. --- 753,759 ----
  588.   such as
  589.   .RB `` binary ''
  590.   or
  591. ! .RB `` ascii ''.
  592.   .TP
  593.   .IR verbose " (String/Integer)"
  594.   Controls the amount of output spewed by the program.
  595. ***************
  596. *** 787,793 ****
  597.   .PP
  598.   The
  599.   .I ls
  600. ! command sends the FTP command ``NLST.''for you.
  601.   This command has been set so that it defaults
  602.   to always listing files in columns (this is the
  603.   .B \-C
  604. --- 787,793 ----
  605.   .PP
  606.   The
  607.   .I ls
  608. ! command sends the FTP command ``NLST'' for you.
  609.   This command has been set so that it defaults
  610.   to always listing files in columns (this is the
  611.   .B \-C
  612. ***************
  613. *** 807,813 ****
  614.   .PP
  615.   The
  616.   .I dir
  617. ! command sends the FTP command ``LIST.''for you, which instead
  618.   of printing just item names, it prints item sizes, owners, dates, and
  619.   permissions as well.
  620.   This command is equivalent to
  621. --- 807,813 ----
  622.   .PP
  623.   The
  624.   .I dir
  625. ! command sends the FTP command ``LIST'' for you, which instead
  626.   of printing just item names, it prints item sizes, owners, dates, and
  627.   permissions as well.
  628.   This command is equivalent to
  629. ***************
  630. *** 974,982 ****
  631.   I call it ``Poor Man's File Completion.''
  632.   If you've done a remote listing, and you decide you want to download a
  633.   file by the name of
  634. ! .RB `` obnoxiouslylongpackagename.tar.Z ,''
  635.   you can use
  636. ! ``PMFC.''to save some keystrokes.
  637.   Choose an expression that will only
  638.   match that one file, then use it with
  639.   .IR get :
  640. --- 974,982 ----
  641.   I call it ``Poor Man's File Completion.''
  642.   If you've done a remote listing, and you decide you want to download a
  643.   file by the name of
  644. ! .RB `` obnoxiouslylongpackagename.tar.Z '',
  645.   you can use
  646. ! ``PMFC'' to save some keystrokes.
  647.   Choose an expression that will only
  648.   match that one file, then use it with
  649.   .IR get :
  650. ***************
  651. *** 1021,1027 ****
  652.   .De
  653.   .PP
  654.   instead.
  655. ! The ``m.''commands will verify each file,
  656.   if you have the program variable
  657.   .I mprompt
  658.   set.
  659. --- 1021,1027 ----
  660.   .De
  661.   .PP
  662.   instead.
  663. ! The ``m'' commands will verify each file,
  664.   if you have the program variable
  665.   .I mprompt
  666.   set.
  667. ***************
  668. *** 1040,1046 ****
  669.   page README.Z
  670.   .De
  671.   .PP
  672. ! The second example show that you can use ``PMFC.''like you can for
  673.   .IR get.
  674.   The third example will work also, because if the program knows how to
  675.   decompress the file, it will do so before feeding it to your pager.
  676. --- 1040,1046 ----
  677.   page README.Z
  678.   .De
  679.   .PP
  680. ! The second example show that you can use ``PMFC'' like you can for
  681.   .IR get.
  682.   The third example will work also, because if the program knows how to
  683.   decompress the file, it will do so before feeding it to your pager.
  684. ***************
  685. *** 1073,1079 ****
  686.   lookup cse.unl.edu
  687.   .De
  688.   .PP
  689. ! This would spit out IP number for that site, in this case ``129.93.1.12.''
  690.   If you needed to know what a site's name was, but only knew the IP number,
  691.   try:
  692.   .Ds
  693. --- 1073,1079 ----
  694.   lookup cse.unl.edu
  695.   .De
  696.   .PP
  697. ! This would spit out IP number for that site, in this case ``129.93.1.12''.
  698.   If you needed to know what a site's name was, but only knew the IP number,
  699.   try:
  700.   .Ds
  701. ***************
  702. *** 1080,1086 ****
  703.   lookup 129.93.1.12
  704.   .De
  705.   .PP
  706. ! This would spit out the name for that site, in this case ``cse.unl.edu.''
  707.   .\"-------
  708.   .SH "Checking the configuration of the program"
  709.   .\"-------
  710. --- 1080,1086 ----
  711.   lookup 129.93.1.12
  712.   .De
  713.   .PP
  714. ! This would spit out the name for that site, in this case ``cse.unl.edu''.
  715.   .\"-------
  716.   .SH "Checking the configuration of the program"
  717.   .\"-------
  718. ***************
  719. *** 1111,1117 ****
  720.   You can check the
  721.   .I version
  722.   command to see if either
  723. ! ``GETLINE.''or ``READLINE.''are installed.
  724.   .\"-------
  725.   .SH "Customizing the prompt"
  726.   .\"-------
  727. --- 1111,1117 ----
  728.   You can check the
  729.   .I version
  730.   command to see if either
  731. ! ``GETLINE'' or ``READLINE'' are installed.
  732.   .\"-------
  733.   .SH "Customizing the prompt"
  734.   .\"-------
  735. ***************
  736. *** 1162,1171 ****
  737.   directory path in
  738.   .I "colon-mode"
  739.   format, such as
  740. ! ``cse.unl.edu:/pub/mgleason,.''or ``(not connected).''
  741.   The
  742.   .B @c
  743. ! flag is similar, only it will insert ``cse.unl.edu:/pub/mgleason.''and a
  744.   newline if connected, otherwise it prints nothing.
  745.   The default prompt uses
  746.   this flag to print a two line prompt when connected and a one line prompt
  747. --- 1162,1171 ----
  748.   directory path in
  749.   .I "colon-mode"
  750.   format, such as
  751. ! ``cse.unl.edu:/pub/mgleason'', or ``(not connected)''.
  752.   The
  753.   .B @c
  754. ! flag is similar, only it will insert ``cse.unl.edu:/pub/mgleason'' and a
  755.   newline if connected, otherwise it prints nothing.
  756.   The default prompt uses
  757.   this flag to print a two line prompt when connected and a one line prompt
  758. ***************
  759. *** 1175,1181 ****
  760.   inserts the event number (how many commands you've typed).
  761.   .PP
  762.   .B @M
  763. ! inserts ``(Mail)\0.''if mail has arrived since running the program.
  764.   .PP
  765.   .B @N
  766.   inserts a newline character.
  767. --- 1175,1181 ----
  768.   inserts the event number (how many commands you've typed).
  769.   .PP
  770.   .B @M
  771. ! inserts ``(Mail)\0'' if mail has arrived since running the program.
  772.   .PP
  773.   .B @N
  774.   inserts a newline character.
  775. ***************
  776. *** 1235,1246 ****
  777.   .TP
  778.   .B \-I
  779.   toggles the mprompt variable; this is provided for compatibility with
  780. ! .RB `` "ftp \-i" .''
  781.   .TP
  782.   .B \-N
  783.   disables reading of the RC file;
  784.   this is provided for compatibility with
  785. ! .RB `` "ftp \-n" .''
  786.   .TP
  787.   .BI \-V " x"
  788.   sets verbosity to level
  789. --- 1235,1246 ----
  790.   .TP
  791.   .B \-I
  792.   toggles the mprompt variable; this is provided for compatibility with
  793. ! .RB `` "ftp \-i" ''.
  794.   .TP
  795.   .B \-N
  796.   disables reading of the RC file;
  797.   this is provided for compatibility with
  798. ! .RB `` "ftp \-n" ''.
  799.   .TP
  800.   .BI \-V " x"
  801.   sets verbosity to level
  802. ***************
  803. *** 1273,1288 ****
  804.   .De
  805.   .PP
  806.   This fetches
  807. ! .B README
  808.   and then quits:
  809.   .Ds
  810. ! csh> ncftp ftp.unl.edu:/pub/README
  811.   .De
  812.   .PP
  813.   Some others examples, with open options and main program options mixed in:
  814.   .Ds
  815.   csh> ncftp \-V quiet \-u ftp.unl.edu
  816. ! csh> ncftp \-c ftp.unl.edu:/pub/README
  817.   csh> ncftp \-D 2 \-r \-d 120 \-g 10 \-N ftp.unl.edu
  818.   .De
  819.   .\"-------
  820. --- 1273,1288 ----
  821.   .De
  822.   .PP
  823.   This fetches
  824. ! .B CONTENTS
  825.   and then quits:
  826.   .Ds
  827. ! csh> ncftp cse.unl.edu:/pub/mgleason/CONTENTS
  828.   .De
  829.   .PP
  830.   Some others examples, with open options and main program options mixed in:
  831.   .Ds
  832.   csh> ncftp \-V quiet \-u ftp.unl.edu
  833. ! csh> ncftp \-c cse.unl.edu:/pub/mgleason/CONTENTS
  834.   csh> ncftp \-D 2 \-r \-d 120 \-g 10 \-N ftp.unl.edu
  835.   .De
  836.   .\"-------
  837. ***************
  838. *** 1321,1327 ****
  839.   # If an antiquated non-UNIX machine doesn't use
  840.   # the "SYST" command, you may need to unset
  841.   # remote\-is\-unix, if the remote host complains
  842. ! # about ``ls \-CF.''
  843.   machine some.vms.unl.edu
  844.       macdef init
  845.       unset remote\-is\-unix
  846. --- 1321,1327 ----
  847.   # If an antiquated non-UNIX machine doesn't use
  848.   # the "SYST" command, you may need to unset
  849.   # remote\-is\-unix, if the remote host complains
  850. ! # about ``ls \-CF''.
  851.   machine some.vms.unl.edu
  852.       macdef init
  853.       unset remote\-is\-unix
  854. diff -c ./open.c ../ncftp151/open.c
  855. *** ./open.c    Tue Aug 24 16:33:43 1993
  856. --- ../ncftp151/open.c    Sun Aug 29 21:47:39 1993
  857. ***************
  858. *** 436,449 ****
  859.       char *user, *pass, *acct;    
  860.       int                    login_verbosity;
  861.   
  862. -     /* If there is already a site open, close that one so we can
  863. -      * open a new one.
  864. -      */
  865. -     if (connected && NOT_VQUIET && hostname[0]) {
  866. -         (void) printf("Closing %s...\n", hostname);
  867. -         (void) disconnect(0, NULL);
  868. -     }
  869.       ruser = rpass = racct = NULL;
  870.       /* This also loads the init macro. */
  871.       siteInRC = ruserpass2(openopt->hostname, &ruser, &rpass, &racct);
  872. --- 436,441 ----
  873. ***************
  874. *** 584,589 ****
  875. --- 576,589 ----
  876.   int cmdOpen(int argc, char **argv)
  877.   {
  878.       OpenOptions            openopt;
  879. +     /* If there is already a site open, close that one so we can
  880. +      * open a new one.
  881. +      */
  882. +     if (connected && NOT_VQUIET && hostname[0]) {
  883. +         (void) printf("Closing %s...\n", hostname);
  884. +         (void) disconnect(0, NULL);
  885. +     }
  886.   
  887.       if ((GetOpenOptions(argc, argv, &openopt) == USAGE) ||
  888.           (Open(&openopt) == USAGE))
  889. diff -c ./patchlevel.h ../ncftp151/patchlevel.h
  890. *** ./patchlevel.h    Tue Aug 24 16:33:43 1993
  891. --- ../ncftp151/patchlevel.h    Sun Aug 29 21:57:39 1993
  892. ***************
  893. *** 43,49 ****
  894.    *  shouldn't.  Fixed bug in macdef.  Fixed small bug in getreply.  Turned
  895.    *  off echoing during the progress-meter.  Added syslogging capability.
  896.    *
  897. !  * v1.4.0 - Summer 1993, not finished yet. 
  898.    *  Fixed error in CONST block in ftpdefs.h.  Fixed error in sys.h so that when
  899.    *  you compile with -DGETPASS it uses getpass.  'ls' bug with wildcards
  900.    *  fixed.  'ls' enhanced to take multiple remote paths.  Added new cpp symbol
  901. --- 43,49 ----
  902.    *  shouldn't.  Fixed bug in macdef.  Fixed small bug in getreply.  Turned
  903.    *  off echoing during the progress-meter.  Added syslogging capability.
  904.    *
  905. !  * v1.5.0 - August 22, 1993
  906.    *  Fixed error in CONST block in ftpdefs.h.  Fixed error in sys.h so that when
  907.    *  you compile with -DGETPASS it uses getpass.  'ls' bug with wildcards
  908.    *  fixed.  'ls' enhanced to take multiple remote paths.  Added new cpp symbol
  909. ***************
  910. *** 101,104 ****
  911. --- 101,114 ----
  912.    *  open.{c,h} dedicated to it; broke up setpeer into smaller sub-procs,
  913.    *  and commented whole file (yay!).  Added a new user var, anon-open,
  914.    *  for those folks who don't want anon logins as the default.
  915. +  *
  916. +  * v1.5.1 - August 29, 1993
  917. +  *  Bugs fixed in termcap code, mput, and pwd.  No longer adding blank
  918. +  *  lines to readline's history.  Netrc site abbreviations were matched
  919. +  *  by strncmp() when it should have been strstr().  Bug fixed in
  920. +  *  open's site "menu."  Revised tips a little to encourage .ncftprc instead
  921. +  *  of .netrc.  TRY_ABOR documented in the README.  Added stuff to the
  922. +  *  DYNIX entry.  Hacks added for SCO322.  Shortened bargraph prog meter
  923. +  *  by one char.  Better compat with getline.  Man page fixed by DWS again :)
  924.    */
  925. diff -c ./sys.h ../ncftp151/sys.h
  926. *** ./sys.h    Tue Aug 24 16:33:43 1993
  927. --- ../ncftp151/sys.h    Sun Aug 29 21:47:41 1993
  928. ***************
  929. *** 56,61 ****
  930. --- 56,66 ----
  931.   #    define SYSSELECTH 1
  932.   #endif    /* _AIX */
  933.   
  934. + #ifdef SCO322
  935. + #    define BOTCHED_FOPEN_RW
  936. + #    define SCO324
  937. + #endif
  938.   #ifdef SCO324
  939.   #    define System "SCO Unix"
  940.   #    ifndef SYSV
  941. ***************
  942. *** 115,123 ****
  943. --- 120,135 ----
  944.   #    ifndef SGTTYB
  945.   #        define SGTTYB 1
  946.   #    endif
  947. + #    ifndef NO_UTIMEH
  948. + #        define NO_UTIMEH 1
  949. + #    endif
  950.   #    ifndef NO_STDLIBH
  951.   #        define NO_STDLIBH 1
  952.   #    endif
  953. + #    ifndef NO_VARARGS
  954. + #        define NO_VARARGS 1
  955. + #    endif
  956. + #    include <sys/types.h>
  957.   #endif    /* DYNIX */
  958.   
  959.   #ifdef ultrix
  960. diff -c ./tips.c ../ncftp151/tips.c
  961. *** ./tips.c    Tue Aug 24 16:33:43 1993
  962. --- ../ncftp151/tips.c    Sun Aug 29 21:47:41 1993
  963. ***************
  964. *** 24,30 ****
  965.       "Have you tried typing 'open' by itself lately?",
  966.   
  967.       "If you don't want a .ncrecent file in your home directory, put the \n\
  968. !      command '#unset recent-list' in your .netrc/.ncftprc file.",
  969.   
  970.       "pseudo-filename-completion is supported in some commands.  To use it,\n\
  971.        use a wildcard expression that will match exactly one file.  I.e., if you\n\
  972. --- 24,30 ----
  973.       "Have you tried typing 'open' by itself lately?",
  974.   
  975.       "If you don't want a .ncrecent file in your home directory, put the \n\
  976. !      command '#unset recent-list' in your .ncftprc file.",
  977.   
  978.       "pseudo-filename-completion is supported in some commands.  To use it,\n\
  979.        use a wildcard expression that will match exactly one file.  I.e., if you\n\
  980. ***************
  981. *** 32,46 ****
  982.        you can't use the cd command with this feature (yet).",
  983.   
  984.       "You don't need to type the exact site name with open.  If a site is in\n\
  985. !      your .netrc/.ncftprc or the recent-list (.ncrecent), just type a unique\n\
  986.        abbreviation (substring really).   I.e. 'open wuar' if you have the site\n\
  987. !      wuarchive.wustl.edu in your rc or recent-list.",
  988.   
  989. !     "You can put set commands in your .netrc/.ncftprc, by adding lines such\n\
  990.        as '#set local-dir /usr/tmp' to the file, which will be run at startup.",
  991.   
  992. !     "Abuse the power of the .netrc!  Put in entries for your favorite sites.\n\
  993. !      Sample .netrc (or .ncftprc):\n\
  994.        #set pager \"less -M\"\n\
  995.        \n\
  996.        machine wuarchive.wustl.edu\n\
  997. --- 32,47 ----
  998.        you can't use the cd command with this feature (yet).",
  999.   
  1000.       "You don't need to type the exact site name with open.  If a site is in\n\
  1001. !      your .ncftprc or the recent-file (.ncrecent), just type a unique\n\
  1002.        abbreviation (substring really).   I.e. 'open wuar' if you have the site\n\
  1003. !      wuarchive.wustl.edu in your rc or recent-file.",
  1004.   
  1005. !     "You can put set commands in your .ncftprc, by adding lines such\n\
  1006.        as '#set local-dir /usr/tmp' to the file, which will be run at startup.",
  1007.   
  1008. !     "Use the .ncftprc file to set variables at startup and to add sites that \n\
  1009. !      need init macros.\n\
  1010. !      Sample .ncftprc:\n\
  1011.        #set pager \"less -M\"\n\
  1012.        \n\
  1013.        machine wuarchive.wustl.edu\n\
  1014. ***************
  1015. *** 53,60 ****
  1016.       "If you want to keep your .netrc's for ftp and ncftp separate, name\n\
  1017.        ncftp's rc to .ncftprc.",
  1018.   
  1019. !     "Type 'open' by itself to get a list of the sites in your recent-list and\n\
  1020. !      your .netrc.  You can then supply '#5' at the prompt, or use 'open #5'\n\
  1021.        later.",
  1022.   
  1023.       "Colon-mode is a quick way to get a file from your shell.  Try something\n\
  1024. --- 54,61 ----
  1025.       "If you want to keep your .netrc's for ftp and ncftp separate, name\n\
  1026.        ncftp's rc to .ncftprc.",
  1027.   
  1028. !     "Type 'open' by itself to get a list of the sites in your recent-file and\n\
  1029. !      your .ncftprc.  You can then supply '#5' at the prompt, or use 'open #5'\n\
  1030.        later.",
  1031.   
  1032.       "Colon-mode is a quick way to get a file from your shell.  Try something\n\
  1033. ***************
  1034. *** 104,110 ****
  1035.        output of the 'version' command in your message.  An easy way to do that\n\
  1036.        is to compose your message, then do a 'ncftp -H >> msg.'",
  1037.   
  1038. !     "Sick and tired of these tips?  Put '#unset tips' in your .netrc/.ncftprc."
  1039.   };
  1040.   
  1041.   /* Not another dinky header, por favor. */
  1042. --- 105,115 ----
  1043.        output of the 'version' command in your message.  An easy way to do that\n\
  1044.        is to compose your message, then do a 'ncftp -H >> msg.'",
  1045.   
  1046. !     "Don't put a site in your .ncftprc unless you want an 'init' macro.  The \n\
  1047. !      recent-file saves sites with the last directory you were in, unlike \n\
  1048. !      the rc file, while still letting you use sitename abbreviations."
  1049. !     "Sick and tired of these tips?  Put '#unset tips' in your .ncftprc."
  1050.   };
  1051.   
  1052.   /* Not another dinky header, por favor. */
  1053. diff -c ./util.c ../ncftp151/util.c
  1054. *** ./util.c    Tue Aug 24 16:33:43 1993
  1055. --- ../ncftp151/util.c    Sun Aug 29 21:47:41 1993
  1056. ***************
  1057. *** 395,401 ****
  1058.    * to scan the prompt for all escape sequences.
  1059.    */
  1060.   /*ARGSUSED*/
  1061. ! static int MainPromptLen(char *pr)
  1062.   {
  1063.       return (int)epromptlen;
  1064.   }
  1065. --- 395,401 ----
  1066.    * to scan the prompt for all escape sequences.
  1067.    */
  1068.   /*ARGSUSED*/
  1069. ! static size_t MainPromptLen(char *pr)
  1070.   {
  1071.       return (int)epromptlen;
  1072.   }
  1073. ***************
  1074. *** 454,460 ****
  1075.           (void) _Strncpy(sline, cp, size);
  1076.           free(cp);
  1077.           (void) RemoveTrailingNewline(cp = sline, NULL);
  1078. !         add_history(cp);
  1079.       }
  1080.   #else    /* READLINE */
  1081.   
  1082. --- 454,461 ----
  1083.           (void) _Strncpy(sline, cp, size);
  1084.           free(cp);
  1085.           (void) RemoveTrailingNewline(cp = sline, NULL);
  1086. !         if (*cp != 0)    /* Don't add blank lines to history buffer. */
  1087. !             add_history(cp);
  1088.       }
  1089.   #else    /* READLINE */
  1090.   
  1091. ***************
  1092. *** 464,477 ****
  1093.               gl_strwidth(MainPromptLen);
  1094.           if ((cp = getline(promptstr)) != NULL) {
  1095.               (void) _Strncpy(sline, cp, size);
  1096. !             if (!*cp) {
  1097. !                 cp = NULL;
  1098. !             } else {
  1099.                   gl_histadd(cp);
  1100.                   cp = sline;
  1101.               }
  1102.           }
  1103. !         gl_strwidth((int (*)(char *)) strlen);
  1104.       } else {
  1105.   #ifdef CURSES
  1106.           tcap_put(promptstr);
  1107. --- 465,477 ----
  1108.               gl_strwidth(MainPromptLen);
  1109.           if ((cp = getline(promptstr)) != NULL) {
  1110.               (void) _Strncpy(sline, cp, size);
  1111. !             if (*cp != 0) {        /* Don't add blank lines to history buffer. */
  1112.                   gl_histadd(cp);
  1113.                   cp = sline;
  1114.               }
  1115.           }
  1116. !         /* Hope your strlen is declared as returning a size_t. */
  1117. !         gl_strwidth(strlen);
  1118.       } else {
  1119.   #ifdef CURSES
  1120.           tcap_put(promptstr);
  1121. --
  1122. ______________________________________________________________________________
  1123. mike gleason                 mgleason@cse.unl.edu             NCEMRSoft, baby!
  1124.  
  1125. exit 0 # Just in case...
  1126.