home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1796 < prev    next >
Encoding:
Internet Message Format  |  1990-12-28  |  3.7 KB

  1. From: rhg@cpsolv.CPS.COM (Richard H. Gumpertz)
  2. Newsgroups: alt.sources,alt.sources.patches
  3. Subject: shar 3.43 patch 1 (to make version 3.44)
  4. Message-ID: <538@cpsolv.CPS.COM>
  5. Date: 9 Sep 90 03:32:51 GMT
  6.  
  7. Submitted-by: rhg@cpsolv.cps.com
  8. Archive-name: shar3.43/patch01
  9.  
  10. Wouldn't you know it?  After more than a month of silence from beta testers I
  11. finally decided to post shar 3.43 to alt.sources.  Only a few hours later a
  12. bug report showed up!  Moby sigh.  Anyway, here is the fix for a minor bug
  13. and an enhancement.
  14.  
  15. 1) A line containing just "SHAR_EOF" in an input file now gets an 'X' prepended
  16. in the output file even if -F is not specified.
  17.  
  18. 2) The new compile-time definition NO_DIRENT indicates that the SunOS3-style
  19. <sys/dir.h> should be used instead of Gwyn-style (or equivalent) <dirent.h>.
  20.  
  21. Thanks to Frans Meulenbroeks (meulenbr@cst.philips.nl) for reporting the two
  22. problems.
  23.  
  24. *** /tmp/,RCSt1a01064    Sat Sep  8 22:04:42 1990
  25. --- shar.c    Sat Sep  8 22:04:51 1990
  26. ***************
  27. *** 1,5 ****
  28. ! char *revision = "3.43";
  29. ! char RCS_ID[] = "$Header: /u/rhg/src/shar/shar.c,v 3.43 90/08/13 07:50:34 rhg Exp $";
  30.   /*
  31.   ** shar.c
  32.   
  33. --- 1,5 ----
  34. ! char *revision = "3.44";
  35. ! char RCS_ID[] = "$Header: /u/rhg/src/shar/shar.c,v 3.44 90/09/08 22:01:39 rhg Exp $";
  36.   /*
  37.   ** shar.c
  38.   
  39. ***************
  40. *** 16,21 ****
  41. --- 16,23 ----
  42.   
  43.   */
  44.   /*+:EDITS:*/
  45. + /*:09-08-1990-21:20-rhg@cps.com-added NO_DIRENT for SunOS 3 sys/dir.h */
  46. + /*:09-08-1990-21:04-rhg@cps.com-fixed bug in PREFIX check: strcmp(line,Delim) */
  47.   /*:08-06-1990-00:40-rhg@cps.com-revised Cut message to be more explanatory */
  48.   /*:08-05-1990-14:04-rhg@cps.com-merged Rname into walktree */
  49.   /*:08-05-1990-12:11-rhg@cps.com-added walktree & support for sharing dirs */
  50. ***************
  51. *** 584,592 ****
  52.   
  53.   #else /* NO_WALKTREE*/
  54.   
  55.   #include <dirent.h>            /* Doug Gwyn's dirent routines */
  56.   DIR *opendir();
  57. ! struct dirent *readdir();
  58.   int closedir();
  59.   
  60.   int
  61. --- 586,605 ----
  62.   
  63.   #else /* NO_WALKTREE*/
  64.   
  65. + #ifdef NO_DIRENT
  66. + #include <sys/dir.h>            /* SunOS 3, etc. */
  67. + #define DIRENTRY struct direct
  68. + #else /* NO_DIRENT */
  69.   #include <dirent.h>            /* Doug Gwyn's dirent routines */
  70. + #define DIRENTRY struct dirent
  71. + #endif /* NO_DIRENT */
  72.   DIR *opendir();
  73. ! DIRENTRY *readdir();
  74.   int closedir();
  75.   
  76.   int
  77. ***************
  78. *** 596,602 ****
  79.   int filelen;
  80.   {
  81.       DIR *dirp;
  82. !     struct dirent *dp;
  83.   
  84.       if(stat(file,&fst))
  85.       {
  86. --- 609,615 ----
  87.   int filelen;
  88.   {
  89.       DIR *dirp;
  90. !     DIRENTRY *dp;
  91.   
  92.       if(stat(file,&fst))
  93.       {
  94. ***************
  95. *** 1084,1093 ****
  96.           while(fgets(line,BUFSIZ,fpsource))
  97.           { /* output a line and test the length */
  98.               if(OptPREFIX && isgraph(line[0]) && line[0] != PREFIX
  99.   #ifdef STRNCMP_IS_FAST
  100. !                && strncmp(line,"exit 0",6))    /* See "unshar -e" */
  101.   #else /* STRNCMP_IS_FAST */
  102. !                && (line[0] != 'e' || strncmp(line,"exit 0",6))) /* unshar -e */
  103.   #endif /* STRNCMP_IS_FAST */
  104.                   fputs(line,fpout);
  105.               else
  106. --- 1097,1111 ----
  107.           while(fgets(line,BUFSIZ,fpsource))
  108.           { /* output a line and test the length */
  109.               if(OptPREFIX && isgraph(line[0]) && line[0] != PREFIX
  110. + #ifdef STRCMP_IS_FAST
  111. +                && strcmp(line,Delim)
  112. + #else /* STRCMP_IS_FAST */
  113. +                && line[0] != Delim[0]
  114. + #endif /* STRCMP_IS_FAST */
  115.   #ifdef STRNCMP_IS_FAST
  116. !                && strncmp(line,"exit 0",6))    /* See unshar -e: avoid "exit 0" */
  117.   #else /* STRNCMP_IS_FAST */
  118. !                && (line[0] != 'e'))            /* See unshar -e: avoid "exit 0" */
  119.   #endif /* STRNCMP_IS_FAST */
  120.                   fputs(line,fpout);
  121.               else
  122. -- 
  123.   ==========================================================================
  124.   | Richard H. Gumpertz    rhg@CPS.COM    (913) 642-1777 or (816) 891-3561 |
  125.   | Computer Problem Solving, 8905 Mohawk Lane, Leawood, Kansas 66206-1749 |
  126.   ==========================================================================
  127.