home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sources / misc / 4160 next >
Encoding:
Text File  |  1992-12-12  |  10.5 KB  |  410 lines

  1. Newsgroups: comp.sources.misc
  2. Path: sparky!kent
  3. From: mgleason@cse.unl.edu (Mike Gleason)
  4. Subject:  v34i020:  ncftp - Alternative User Interface for FTP, Patch01
  5. Message-ID: <1992Dec12.193605.27105@sparky.imd.sterling.com>
  6. Followup-To: comp.sources.d
  7. X-Md4-Signature: c35507568c9083aa07b820fd3c505cf6
  8. Sender: kent@sparky.imd.sterling.com (Kent Landfield)
  9. Organization: NCEMRSoft
  10. References: <csm-v34i014=ncftp.150928@sparky.IMD.Sterling.COM>
  11. Date: Sat, 12 Dec 1992 19:36:05 GMT
  12. Approved: kent@sparky.imd.sterling.com
  13. Lines: 395
  14.  
  15. Submitted-by: mgleason@cse.unl.edu (Mike Gleason)
  16. Posting-number: Volume 34, Issue 20
  17. Archive-name: ncftp/patch01
  18. Environment: UNIX, ANSI-C, getopt
  19. Patch-To: ncftp: Volume 34, Issue 14-16
  20.  
  21. This is the first Official patch to ncftp.  It fixes the silly pdir
  22. bug and some other minor glitches (see patchlevel.h).  You can now also
  23. define GETPASS (see sys.h) if you have been having problems compiling near
  24. the getpass2() function in cmds.c (~line 2000).
  25.  
  26. Save this file as 'pl1', and put it in the same directory as your ncftp
  27. source, then type 'patch -c < pl1'.
  28.  
  29. diff -c ./Blurb ../new/Blurb
  30. *** ./Blurb    Tue Dec  8 16:58:32 1992
  31. --- ../new/Blurb    Tue Dec  8 16:58:40 1992
  32. ***************
  33. *** 1,4 ****
  34. ! Subject:  ncftp - Alternative User Interface for FTP, part 01/01
  35.   
  36.   Archive-name: ncftp/part01
  37.   Environment: UNIX, ANSI-C, getopt
  38. --- 1,4 ----
  39. ! Subject:  ncftp - Alternative User Interface for FTP, Part01/01
  40.   
  41.   Archive-name: ncftp/part01
  42.   Environment: UNIX, ANSI-C, getopt
  43. diff -c ./Makefile ../new/Makefile
  44. *** ./Makefile    Tue Dec  8 16:58:32 1992
  45. --- ../new/Makefile    Tue Dec  8 16:58:41 1992
  46. ***************
  47. *** 31,37 ****
  48.   #LFLAGS=-g
  49.   
  50.   # Additional libraries.
  51. ! # Some may need any of -lsocket, -lnet, -linet. 
  52.   # You'll need -ltermcap if TCAP is defined
  53.   #
  54.   MORELIBS= 
  55. --- 31,37 ----
  56.   #LFLAGS=-g
  57.   
  58.   # Additional libraries.
  59. ! # Some may need any of -lsocket, -lnet, -linet, or -lnsl. 
  60.   # You'll need -ltermcap if TCAP is defined
  61.   #
  62.   MORELIBS= 
  63. ***************
  64. *** 116,120 ****
  65. --- 116,131 ----
  66.   mantst:
  67.       nroff -man ncftp.1 > ncftp.man
  68.       less ncftp.man
  69. + patch:
  70. +     -rm -rf /tmp/old /tmp/new
  71. +     -mkdir /tmp/old /tmp/new
  72. +     cp ~/ncftp.shar /tmp/old/oldncftp.shar
  73. +     (cd /tmp/old ; unshar -n oldncftp.shar )
  74. +     make shar
  75. +     cp ncftp.shar /tmp/new
  76. +     (cd /tmp/new; unshar -n ncftp.shar )
  77. +     rm /tmp/new/ncftp.shar /tmp/old/oldncftp.shar
  78. +     (cd /tmp/old ; diff -c . ../new > ../pch)
  79.   
  80.   # eof
  81. diff -c ./cmds.c ../new/cmds.c
  82. *** ./cmds.c    Tue Dec  8 16:58:29 1992
  83. --- ../new/cmds.c    Tue Dec  8 16:58:37 1992
  84. ***************
  85. *** 122,128 ****
  86. --- 122,132 ----
  87.   char *get_cwd(char *buf, int size)
  88.   {
  89.   #ifdef SYSV
  90. + #ifdef GETCWDSIZET
  91. +     extern char *getcwd(char *, size_t);
  92. + #else
  93.       extern char *getcwd(char *, int);
  94. + #endif
  95.       return (getcwd(buf, size - 1));
  96.   #else
  97.       extern char *getwd(char *);
  98. ***************
  99. *** 1108,1114 ****
  100.   {
  101.       char        *whichcmd, *remote, *local, *cp;
  102.       str32        lsflags;
  103. -     string        zpager;
  104.       int            listmode, pagemode, defltFlags;
  105.   
  106.   #ifdef REDIR
  107. --- 1112,1117 ----
  108. ***************
  109. *** 1148,1164 ****
  110.           }    
  111.       }
  112.   
  113. !     if (pagemode) {
  114. !         size_t len = strlen(remote);
  115. !         if (remote[len - 1] == 'Z' && remote[len - 2] == '.') {
  116. !             /* run uncompress first, then pipe through pager. */
  117. !             (void) Strncpy(zpager, "|uncompress ");
  118. !             (void) Strncat(zpager, pager);
  119. !             local = zpager;
  120. !         } else 
  121. !             local = pager;
  122. !     } else
  123. !         local = "-";
  124.       
  125.       /* Possible scenarios:
  126.           1.    ls
  127. --- 1151,1157 ----
  128.           }    
  129.       }
  130.   
  131. !     local = pagemode ? pager : "-";
  132.       
  133.       /* Possible scenarios:
  134.           1.    ls
  135. ***************
  136. *** 1999,2004 ****
  137. --- 1992,1999 ----
  138.   }    /* create */
  139.   
  140.   
  141. + #ifndef GETPASS
  142.   /* Peter Jaspers-Fayer    pjf@osiris.cs.uoguelph.ca    Nov'92 */
  143.   char *getpass2(char *promptstr)
  144.   {
  145. ***************
  146. *** 2025,2031 ****
  147. --- 2020,2029 ----
  148.       return (pass);
  149.   }                                       /* getpass2 */
  150.   
  151. + #endif /* GETPASS */
  152.   
  153.   /* show version info */
  154.   /*ARGSUSED*/
  155.   int show_version(int argc, char **argv)
  156. ***************
  157. *** 2071,2076 ****
  158. --- 2069,2080 ----
  159.   #endif
  160.   #ifdef const
  161.       DStrs[nDStrs++] = "const";
  162. + #endif
  163. + #ifdef GETPASS
  164. +     DStrs[nDStrs++] = "GETPASS";
  165. + #endif
  166. + #ifdef GETCWDSIZET
  167. +     DStrs[nDStrs++] = "GETCWDSIZET";
  168.   #endif
  169.   #ifdef HOSTNAME
  170.       DStrs[nDStrs++] = "HOSTNAME";
  171. diff -c ./ftpdefs.h ../new/ftpdefs.h
  172. *** ./ftpdefs.h    Tue Dec  8 16:58:31 1992
  173. --- ../new/ftpdefs.h    Tue Dec  8 16:58:39 1992
  174. ***************
  175. *** 3,9 ****
  176.   #ifndef _ftpdefs_h_
  177.   #define _ftpdefs_h_
  178.   
  179. ! #define FTP_VERSION "NcFTP 1.0 (6 Dec 92)"
  180.   
  181.   typedef char string[128], str32[32];
  182.   
  183. --- 3,9 ----
  184.   #ifndef _ftpdefs_h_
  185.   #define _ftpdefs_h_
  186.   
  187. ! #define FTP_VERSION "NcFTP 1.0 PL1 (8 Dec 92)"
  188.   
  189.   typedef char string[128], str32[32];
  190.   
  191. ***************
  192. *** 15,26 ****
  193.       int        uid;
  194.   };
  195.   
  196. ! /* Your compiler may not like the 'const' directives.  If it chokes
  197. !  * here, add -Dconst to your SDEFS line in the Makefile, or delete the word
  198. !  * const here.
  199.    */
  200.   #define Strncpy(a,b) strncpy((a), (const char *) (b), (size_t) sizeof (a))
  201.   #define Strncat(a,b) strncat((a), (const char *) (b), (size_t) sizeof (a))
  202.   #define FGets(a,b) fgets((a), sizeof(a) - 1, (b))
  203.   
  204.   #endif /* _ftpdefs_h_ */
  205. --- 15,32 ----
  206.       int        uid;
  207.   };
  208.   
  209. ! /*
  210. !  * Your compiler may not like the 'const' directives.  If it chokes
  211. !  * here, add -Dconst="" to your SDEFS line in the Makefile.
  212.    */
  213. + #ifndef const
  214.   #define Strncpy(a,b) strncpy((a), (const char *) (b), (size_t) sizeof (a))
  215.   #define Strncat(a,b) strncat((a), (const char *) (b), (size_t) sizeof (a))
  216. + #else
  217. + #define Strncpy(a,b) strncpy((a), (char *) (b), (size_t) sizeof (a))
  218. + #define Strncat(a,b) strncat((a), (char *) (b), (size_t) sizeof (a))
  219. + #endif
  220.   #define FGets(a,b) fgets((a), sizeof(a) - 1, (b))
  221.   
  222.   #endif /* _ftpdefs_h_ */
  223. diff -c ./glob.c ../new/glob.c
  224. *** ./glob.c    Tue Dec  8 16:58:30 1992
  225. --- ../new/glob.c    Tue Dec  8 16:58:38 1992
  226. ***************
  227. *** 26,31 ****
  228. --- 26,35 ----
  229.   #include "cmds.h"
  230.   #include "copyright.h"
  231.   
  232. + #ifndef NCARGS
  233. + #    define NCARGS  5120         /* # characters in exec arglist */
  234. + #endif
  235.   #define    QUOTE 0200
  236.   #define    TRIM 0177
  237.   #define    eq(a,b)        (strcmp(a, b)==0)
  238. diff -c ./ncftp.1 ../new/ncftp.1
  239. *** ./ncftp.1    Tue Dec  8 16:58:32 1992
  240. --- ../new/ncftp.1    Tue Dec  8 16:58:41 1992
  241. ***************
  242. *** 233,244 ****
  243.   In previous versions of
  244.   .I ftp
  245.   you could ``get\ myfile.txt\ |more'', but this wasn't widely known.
  246.   .TP
  247.   .I pls
  248.   This lets you view a
  249.   .I ls
  250. ! command with your pager.  This command also lets you view compressed
  251. ! files (ending in .Z), by piping the remote file through
  252.   .I zcat
  253.   first.
  254.   .TP
  255. --- 233,245 ----
  256.   In previous versions of
  257.   .I ftp
  258.   you could ``get\ myfile.txt\ |more'', but this wasn't widely known.
  259. + This command also lets you view compressed
  260. + files (ending in .Z), by piping the remote file through
  261.   .TP
  262.   .I pls
  263.   This lets you view a
  264.   .I ls
  265. ! command with your pager.  
  266.   .I zcat
  267.   first.
  268.   .TP
  269. ***************
  270. *** 526,532 ****
  271.   .SH BUGS
  272.   Correct execution of many commands depends upon proper behavior
  273.   by the remote server.
  274. ! .SP
  275.   Termcap padding is not correctly displayed.
  276.   .SH "SEE ALSO"
  277.   .IR strftime (3),
  278. --- 527,536 ----
  279.   .SH BUGS
  280.   Correct execution of many commands depends upon proper behavior
  281.   by the remote server.
  282. ! The remote server may drop the connection if you take a long time when you
  283. ! page remote files.
  284.   Termcap padding is not correctly displayed.
  285.   .SH "SEE ALSO"
  286.   .IR strftime (3),
  287. diff -c ./patchlevel.h ../new/patchlevel.h
  288. *** ./patchlevel.h    Tue Dec  8 16:58:31 1992
  289. --- ../new/patchlevel.h    Tue Dec  8 16:58:40 1992
  290. ***************
  291. *** 3,6 ****
  292. --- 3,18 ----
  293.   /*
  294.    * v1.0.0 - December 6, 1992.
  295.    *    Initial release.
  296. +  *
  297. +  * v1.0.1 - December 8, 1992.
  298. +  *     Added default value for NCARGS in glob.c for systems that don't define it.
  299. +  *    Fixed pdir bug which was caused by me mistakenly adding the page-a-
  300. +  *    compressed-file feature to ls instead of page.  Fixed bug in documentation,
  301. +  *    which had the same error!  Added spec for Ultrix in sys.h.  Fixed error
  302. +  *    in sys.h that recommended -Dconst instead of -Dconst="".  Added GETPASS
  303. +  *    compile flag to use getpass() instead of getpass2(), which make compiling
  304. +  *    easier if the compiler choked in cmds.c.  Added GETCWDSIZET for systems
  305. +  *    whose getcwd() takes a size_t instead of an int.
  306.    */
  307. diff -c ./sys.h ../new/sys.h
  308. *** ./sys.h    Tue Dec  8 16:58:31 1992
  309. --- ../new/sys.h    Tue Dec  8 16:58:40 1992
  310. ***************
  311. *** 9,14 ****
  312. --- 9,15 ----
  313.    *    Silicon Graphics IRIX
  314.    *    AIX
  315.    *    SINIX
  316. +  *    Ultrix
  317.    *
  318.    * For those systems, you should be able to 'make' ncftp without any
  319.    * problems.  Otherwise you will have to configure ncftp manually.
  320. ***************
  321. *** 37,47 ****
  322.    * If SYSV is defined, RINDEX is defined automatically because System V
  323.    * uses strrchr.
  324.    *
  325. !  * Add -Dconst if your compiler chokes on the const directive.
  326.    *
  327.    * Add -DSYSSELECTH if you need <sys/select.h> included for definitions
  328.    * of fd_set, etc.
  329.    *
  330.    * (Optional) Add -DHERROR if you know you have the herror() system
  331.    * call.
  332.    *
  333. --- 38,56 ----
  334.    * If SYSV is defined, RINDEX is defined automatically because System V
  335.    * uses strrchr.
  336.    *
  337. !  * Add -Dconst=\"\" if your compiler chokes on the const directive.
  338.    *
  339.    * Add -DSYSSELECTH if you need <sys/select.h> included for definitions
  340.    * of fd_set, etc.
  341.    *
  342. +  * Add -DGETPASS if you would rather use the standard getpass() system
  343. +  * call, instead of our version, getpass2(), which takes more than 8
  344. +  * characters.  You may want to define this if you are having problems
  345. +  * with compile errors around line 2010, where getpass2() is located.
  346. +  *
  347. +  * (Optional) Add -DGETCWDSIZET if your system's getcwd() takes a size_t
  348. +  * as the second parameter instead of an int.
  349. +  *
  350.    * (Optional) Add -DHERROR if you know you have the herror() system
  351.    * call.
  352.    *
  353. ***************
  354. *** 88,97 ****
  355.   #    endif
  356.   #endif    /* SCO */
  357.   
  358. ! #if defined(__hpux) || defined(HPUX)
  359.   #    define System "HP-UX"
  360.   #    ifndef _HPUX_SOURCE
  361.   #        define _HPUX_SOURCE 1
  362.   #    endif
  363.   #    define SYSV 1
  364.   #endif    /* HPUX */
  365. --- 97,125 ----
  366.   #    endif
  367.   #endif    /* SCO */
  368.   
  369. ! #ifdef ultrix
  370. ! #    define System "Ultrix"
  371. ! #    ifndef BSD
  372. ! #        define BSD 1
  373. ! #    endif
  374. ! #    ifndef const
  375. ! #        define const
  376. ! #    endif
  377. ! #endif    /* ultrix */
  378. ! #ifdef __hpux
  379. ! #    ifndef HPUX
  380. ! #        define HPUX 1
  381. ! #    endif
  382. ! #endif
  383. ! #ifdef HPUX 
  384.   #    define System "HP-UX"
  385.   #    ifndef _HPUX_SOURCE
  386.   #        define _HPUX_SOURCE 1
  387. + #    endif
  388. + #    ifndef GETCWDSIZET
  389. + #        define GETCWDSIZET 1
  390.   #    endif
  391.   #    define SYSV 1
  392.   #endif    /* HPUX */
  393. --
  394. ______________________________________________________________________________
  395. mike gleason                 mgleason@cse.unl.edu             NCEMRSoft, baby!
  396.  
  397. exit 0 # Just in case...
  398.