home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume34 / ncftp / patch01 < prev    next >
Encoding:
Text File  |  1992-12-11  |  10.3 KB  |  404 lines

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