home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume15 / cshar / patch1 < prev    next >
Encoding:
Internet Message Format  |  1988-06-02  |  32.8 KB

  1. Subject:  v15i031:  Tools to create and unpack shell archives, Patch1
  2. Newsgroups: comp.sources.unix,comp.sources.bugs
  3. Summary: This is an official patch for cshar 2.0; please apply it.
  4. Approved: rsalz@uunet.UU.NET
  5.  
  6. Submitted-by: Rich Salz <rsalz@bbn.com>
  7. Posting-number: Volume 15, Issue 31
  8. Archive-name: cshar/patch1
  9.  
  10. This patch includes ports to SysVrel3.1, SysVrel3.2, Xenix, and now always
  11. puts out a leading 'X' unless the otherwise undocumented -DTOO_FANCY flag
  12. is used.
  13.  
  14. Description:
  15.     From: Chuck Musciano <chuck@trantor.harris-atd.com>
  16.     +In shar.c, main() didn't initialize Flist.
  17.  
  18.     From: Geoff Scully <egvideo!gws>
  19.     +Here is a config.h file for Xenix on a 386.
  20.     +Setting DIRLIB=-lx in Makefile results in "can't make -lx" errors.
  21.  
  22.     From: John L. Chmielewski <attmail!jlc> <ihnp4!rogue!jlc>
  23.     +Here is a config.h file for System V release 3.1 or 3.2.
  24.     +The synopsis and usage message for makekit were incomplete.
  25.     +An fprintf was wrong, and could crash or print garbage if you
  26.      try to findsrc a non-existant directory.
  27.     +The file "dirent.h" is really <dirent.h>
  28.     +There were a few niggling declaration inconsistancies that cause
  29.      ANSI-ish compilers to complain.
  30.  
  31.     From: Rich $alz <rsalz@bbn.com>
  32.     +The ctype macros (isdigit(), etc.) can cause problems if handed
  33.      non-ASCII characters.
  34.  
  35. Fix:
  36.     To aid in robustness, patches are not shipped "raw"; I apologize for
  37.     the inconvenience.  Save this message and unshar it; from rn, say
  38.     "|unshar -d DIR", where DIR is your cshar source directory.  Outside
  39.     of rn, say "cd DIR; unshar <thisarticle".  This will create a file
  40.     called patch01, which you can then feed to the patch program.
  41.  
  42.     If you don't have the patch program, make the changes by hand, or get
  43.     patch.
  44.  
  45.     If patch indicates that patchlevel is the wrong version, you may need
  46.     to apply one or more previous patches, or the patch may already have
  47.     been applied.  See the patchlevel.h file to find out what has or has
  48.     not been applied.  In any event, don't continue with the patch.
  49.  
  50.     If any patches are missing, they can be obtained from your nearest
  51.     comp.sources.unix archive.
  52.  
  53. #! /bin/sh
  54. # This is a shell archive.  Remove anything before this line, then unpack
  55. # it by saving it into a file and typing "sh file".  To overwrite existing
  56. # files, type "sh file -c".  You can also feed this as standard input via
  57. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  58. # will see the following message at the end:
  59. #        "End of shell archive."
  60. # Contents:  patch01
  61. # Wrapped by rsalz@fig.bbn.com on Fri Jun  3 12:17:51 1988
  62. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  63. if test -f 'patch01' -a "${1}" != "-c" ; then 
  64.   echo shar: Will not clobber existing file \"'patch01'\"
  65. else
  66. echo shar: Extracting \"'patch01'\" \(29598 characters\)
  67. sed "s/^X//" >'patch01' <<'END_OF_FILE'
  68. Index: patchlevel.h
  69. Prereq: 2.0
  70. X
  71. X*** /tmp/,RCSt1a25600    Fri Jun  3 12:17:03 1988
  72. X--- patchlevel.h    Fri Jun  3 12:16:45 1988
  73. X***************
  74. X*** 2,10 ****
  75. X  **  This file records official patches.  RCS records the edit log.
  76. X  **
  77. X  **  $Log:    patchlevel.h,v $
  78. X  **  Revision 2.0  88/05/27  13:32:13  rsalz
  79. X  **  First comp.sources.unix release
  80. X- **  
  81. X- **  
  82. X  */
  83. X! #define PATCHLEVEL 0
  84. X--- 2,19 ----
  85. X  **  This file records official patches.  RCS records the edit log.
  86. X  **
  87. X  **  $Log:    patchlevel.h,v $
  88. X+ **  Revision 2.1  88/06/03  12:16:40  rsalz
  89. X+ **  patch01:  Add config.x386 and config.sVr3; change "dirent.h" to <dirent.h>
  90. X+ **  patch01:  In Makefile, use $(DIRLIB) only in actions, not dependencies;
  91. X+ **  patch01:  add /usr/man/local option for MANDIR.
  92. X+ **  patch01:  Put isascii() before every use of a <ctype.h> macro. 
  93. X+ **  patch01:  Initialize Flist in shar.c/main().
  94. X+ **  patch01:  Add -x to synopsis in makekit.man; improve the usage message and
  95. X+ **  patch01:  put comments around note after an #endif (ANSI strikes again).
  96. X+ **  patch01:  Remove extraneous declaration of Dispatch[] in parser.c
  97. X+ **  patch01:  Add missing argument in fprintf call in findsrc.
  98. X+ **  
  99. X  **  Revision 2.0  88/05/27  13:32:13  rsalz
  100. X  **  First comp.sources.unix release
  101. X  */
  102. X! #define PATCHLEVEL 1
  103. X*** /tmp/,RCSt1a25447    Fri Jun  3 12:06:03 1988
  104. X--- MANIFEST    Fri Jun  3 12:05:42 1988
  105. X***************
  106. X*** 4,11 ****
  107. X   Makefile                   1    Control file for Unix make program
  108. X   README                     1    Acknowledgements, installation notes
  109. X   config.h                   1    Default configuration file
  110. X   dir.amiga                  2    A partial Amiga readdir package
  111. X!  dir.msdos                  1    An MS-DOS readdir package
  112. X   findsrc.c                  2    Find source files, based on filename
  113. X   findsrc.man                1    Manual page for findsrc
  114. X   glue.c                     1    Glue that so unshar uses my /bin/sh parser
  115. X--- 4,13 ----
  116. X   Makefile                   1    Control file for Unix make program
  117. X   README                     1    Acknowledgements, installation notes
  118. X   config.h                   1    Default configuration file
  119. X+  config.sVr3                1    Configuration for SystemV Releases 3.1 and 3.2
  120. X+  config.x386                1    configuration for Xenix on a 386
  121. X   dir.amiga                  2    A partial Amiga readdir package
  122. X!  dir.msdos                  2    An MS-DOS readdir package
  123. X   findsrc.c                  2    Find source files, based on filename
  124. X   findsrc.man                1    Manual page for findsrc
  125. X   glue.c                     1    Glue that so unshar uses my /bin/sh parser
  126. X***************
  127. X*** 17,23 ****
  128. X   lmem.c                     1    Memory allocator, uses calloc
  129. X   luser.c                    1    Get user's name
  130. X   makekit.c                  2    Partition files into reasonable-sized kits
  131. X!  makekit.man                1    Manual page for makekit
  132. X   parser.c                   3    Interpreter for shell archives
  133. X   patchlevel.h               1    Mistake recorder
  134. X   shar.c                     2    Create script to create files
  135. X--- 19,25 ----
  136. X   lmem.c                     1    Memory allocator, uses calloc
  137. X   luser.c                    1    Get user's name
  138. X   makekit.c                  2    Partition files into reasonable-sized kits
  139. X!  makekit.man                2    Manual page for makekit
  140. X   parser.c                   3    Interpreter for shell archives
  141. X   patchlevel.h               1    Mistake recorder
  142. X   shar.c                     2    Create script to create files
  143. X*** /tmp/,RCSt1a25265    Fri Jun  3 11:53:57 1988
  144. X--- Makefile    Fri Jun  3 11:52:32 1988
  145. X***************
  146. X*** 1,10 ****
  147. X  ##
  148. X  ##  SOURCE-SHIPPING TOOLS MAKEFILE
  149. X! ##  $Header: Makefile,v 2.0 88/05/27 13:29:42 rsalz Exp $
  150. X! ##  $Log:    Makefile,v $
  151. X! # Revision 2.0  88/05/27  13:29:42  rsalz
  152. X! # First comp.sources.unix release
  153. X! # 
  154. X  ##
  155. X  
  156. X  ## Grrrr...
  157. X--- 1,6 ----
  158. X  ##
  159. X  ##  SOURCE-SHIPPING TOOLS MAKEFILE
  160. X! ##  $Header: Makefile,v 2.1 88/06/03 11:38:35 rsalz Exp $
  161. X  ##
  162. X  
  163. X  ## Grrrr...
  164. X***************
  165. X*** 34,39 ****
  166. X--- 30,39 ----
  167. X  1    = 1
  168. X  #MANDIR    = /usr/man/u_man/manl
  169. X  #1    = 1L
  170. X+ #MANDIR    = /usr/man/local
  171. X+ #1    = 1
  172. X+ #MANDIR    = /usr/man/man.M
  173. X+ #1    = M
  174. X  
  175. X  ##
  176. X  ##  END OF CONFIGURATION SECTION
  177. X***************
  178. X*** 41,47 ****
  179. X  
  180. X  ##  Header files.
  181. X  HDRS    = shar.h config.h
  182. X! LIB    = lib.a $(DIRLIB)
  183. X  
  184. X  ##  Programs and documentation.
  185. X  PROGRAMS= findsrc    makekit    shar    unshar    shell
  186. X--- 41,47 ----
  187. X  
  188. X  ##  Header files.
  189. X  HDRS    = shar.h config.h
  190. X! LIB    = lib.a
  191. X  
  192. X  ##  Programs and documentation.
  193. X  PROGRAMS= findsrc    makekit    shar    unshar    shell
  194. X***************
  195. X*** 81,103 ****
  196. X  ##  Programs.
  197. X  findsrc:    findsrc.o $(HDRS) $(LIB)
  198. X      @rm -f $@
  199. X!     $(CC) $(CFLAGS) -o findsrc findsrc.o $(LIB)
  200. X  
  201. X  makekit:    makekit.o $(HDRS) $(LIB)
  202. X      @rm -f $@
  203. X!     $(CC) $(CFLAGS) -o makekit makekit.o $(LIB)
  204. X  
  205. X  shar:        shar.o $(HDRS) $(LIB)
  206. X      @rm -f $@
  207. X!     $(CC) $(CFLAGS) -o shar shar.o $(LIB)
  208. X  
  209. X  shell:        shell.o $(HDRS) $(LIB)
  210. X      @rm -f $@
  211. X!     $(CC) $(CFLAGS) -o shell shell.o $(LIB)
  212. X  
  213. X  unshar:        unshar.o $(HDRS) $(LIB)
  214. X      @rm -f $@
  215. X!     $(CC) $(CFLAGS) -o unshar unshar.c $(LIB)
  216. X  
  217. X  
  218. X  ##  Special case, a version of unshar that uses the /bin/sh interpreter.
  219. X--- 81,103 ----
  220. X  ##  Programs.
  221. X  findsrc:    findsrc.o $(HDRS) $(LIB)
  222. X      @rm -f $@
  223. X!     $(CC) $(CFLAGS) -o findsrc findsrc.o $(LIB) $(DIRLIB)
  224. X  
  225. X  makekit:    makekit.o $(HDRS) $(LIB)
  226. X      @rm -f $@
  227. X!     $(CC) $(CFLAGS) -o makekit makekit.o $(LIB) $(DIRLIB)
  228. X  
  229. X  shar:        shar.o $(HDRS) $(LIB)
  230. X      @rm -f $@
  231. X!     $(CC) $(CFLAGS) -o shar shar.o $(LIB) $(DIRLIB)
  232. X  
  233. X  shell:        shell.o $(HDRS) $(LIB)
  234. X      @rm -f $@
  235. X!     $(CC) $(CFLAGS) -o shell shell.o $(LIB) $(DIRLIB)
  236. X  
  237. X  unshar:        unshar.o $(HDRS) $(LIB)
  238. X      @rm -f $@
  239. X!     $(CC) $(CFLAGS) -o unshar unshar.o $(LIB) $(DIRLIB)
  240. X  
  241. X  
  242. X  ##  Special case, a version of unshar that uses the /bin/sh interpreter.
  243. X***************
  244. X*** 104,110 ****
  245. X  unshar.safe:    unshar.c $(HDRS) $(LIB)
  246. X      @rm -f $@
  247. X      @rm -f unshar.o
  248. X!     $(CC) $(CFLAGS) -DUSE_MY_SHELL -o unshar unshar.c $(LIB)
  249. X      @rm -f unshar.o
  250. X  
  251. X  
  252. X--- 104,110 ----
  253. X  unshar.safe:    unshar.c $(HDRS) $(LIB)
  254. X      @rm -f $@
  255. X      @rm -f unshar.o
  256. X!     $(CC) $(CFLAGS) -DUSE_MY_SHELL -o unshar unshar.c $(LIB) $(DIRLIB)
  257. X      @rm -f unshar.o
  258. X  
  259. X  
  260. X*** /tmp/,RCSt1a25265    Fri Jun  3 11:54:00 1988
  261. X--- config.h    Fri Jun  3 11:52:38 1988
  262. X***************
  263. X*** 4,10 ****
  264. X  **  This is known to work on Ultrix1.2 and Sun3.4 machines; it may work
  265. X  **  on other BSD variants, too.
  266. X  **
  267. X! **  $Header: config.h,v 2.0 88/05/27 13:15:39 rsalz Exp $
  268. X  */
  269. X  
  270. X  
  271. X--- 4,10 ----
  272. X  **  This is known to work on Ultrix1.2 and Sun3.4 machines; it may work
  273. X  **  on other BSD variants, too.
  274. X  **
  275. X! **  $Header: config.h,v 2.1 88/06/03 11:38:40 rsalz Exp $
  276. X  */
  277. X  
  278. X  
  279. X***************
  280. X*** 98,104 ****
  281. X  /*efine IN_DIR                /* <dir.h>            */
  282. X  /*efine IN_DIRECT            /* <direct.h>            */
  283. X  /*efine IN_NDIR                /* "ndir.h"            */
  284. X! /*efine IN_DIRENT            /* "dirent.h"            */
  285. X  
  286. X  /*  What readdir() returns.  Must be a #define because of #include order. */
  287. X  #ifdef    IN_DIRENT
  288. X--- 98,104 ----
  289. X  /*efine IN_DIR                /* <dir.h>            */
  290. X  /*efine IN_DIRECT            /* <direct.h>            */
  291. X  /*efine IN_NDIR                /* "ndir.h"            */
  292. X! /*efine IN_DIRENT            /* <dirent.h>            */
  293. X  
  294. X  /*  What readdir() returns.  Must be a #define because of #include order. */
  295. X  #ifdef    IN_DIRENT
  296. X*** /tmp/,RCSt1a25265    Fri Jun  3 11:54:03 1988
  297. X--- findsrc.c    Fri Jun  3 11:52:49 1988
  298. X***************
  299. X*** 5,11 ****
  300. X  #include "shar.h"
  301. X  #ifdef    RCSID
  302. X  static char RCS[] =
  303. X!     "$Header: findsrc.c,v 2.0 88/05/27 13:26:05 rsalz Exp $";
  304. X  #endif    /* RCSID */
  305. X  
  306. X  
  307. X--- 5,11 ----
  308. X  #include "shar.h"
  309. X  #ifdef    RCSID
  310. X  static char RCS[] =
  311. X!     "$Header: findsrc.c,v 2.1 88/06/03 11:38:51 rsalz Exp $";
  312. X  #endif    /* RCSID */
  313. X  
  314. X  
  315. X***************
  316. X*** 76,82 ****
  317. X      return(FALSE);
  318. X  
  319. X      /* Want .cshrc, .newsrc, etc.? */
  320. X!     if (*s == '.' && isalpha(s[1]))
  321. X      return(DoDOTFILES);
  322. X  
  323. X      /* RCS or SCCS file or directory? */
  324. X--- 76,82 ----
  325. X      return(FALSE);
  326. X  
  327. X      /* Want .cshrc, .newsrc, etc.? */
  328. X!     if (*s == '.' && isascii(s[1]) && isalpha(s[1]))
  329. X      return(DoDOTFILES);
  330. X  
  331. X      /* RCS or SCCS file or directory? */
  332. X***************
  333. X*** 98,104 ****
  334. X      if ((p = d) && (*++p == 'c' || *p == 'h') && *++p == '\0')
  335. X  
  336. X      /* Manpage (*.[1234567890] or *.man)? */
  337. X!     if ((p = d) && isdigit(*p))
  338. X      return(TRUE);
  339. X      if ((p = d) && *++p == 'm' && *++p == 'a' && *++p == 'n')
  340. X      return(TRUE);
  341. X--- 98,104 ----
  342. X      if ((p = d) && (*++p == 'c' || *p == 'h') && *++p == '\0')
  343. X  
  344. X      /* Manpage (*.[1234567890] or *.man)? */
  345. X!     if ((p = d) && isascii(s[1]) && isdigit(*p))
  346. X      return(TRUE);
  347. X      if ((p = d) && *++p == 'm' && *++p == 'a' && *++p == 'n')
  348. X      return(TRUE);
  349. X***************
  350. X*** 175,181 ****
  351. X  #endif    /* MSDOS */
  352. X  
  353. X      if (!GetStat(p))
  354. X!     Fprintf(stderr, "Can't walk down %s, %s.\n", Ermsg(errno));
  355. X      else {
  356. X      /* Skip leading ./ which find(1), e.g., likes to put out. */
  357. X      if (p[0] == '.' && p[1] == '/')
  358. X--- 175,181 ----
  359. X  #endif    /* MSDOS */
  360. X  
  361. X      if (!GetStat(p))
  362. X!     Fprintf(stderr, "Can't walk down %s, %s.\n", p, Ermsg(errno));
  363. X      else {
  364. X      /* Skip leading ./ which find(1), e.g., likes to put out. */
  365. X      if (p[0] == '.' && p[1] == '/')
  366. X*** /tmp/,RCSt1a25265    Fri Jun  3 11:54:09 1988
  367. X--- makekit.c    Fri Jun  3 11:53:06 1988
  368. X***************
  369. X*** 5,11 ****
  370. X  #include "shar.h"
  371. X  #ifdef    RCSID
  372. X  static char RCS[] =
  373. X!     "$Header: makekit.c,v 2.0 88/05/27 13:27:31 rsalz Exp $";
  374. X  #endif    /* RCSID */
  375. X  
  376. X  
  377. X--- 5,11 ----
  378. X  #include "shar.h"
  379. X  #ifdef    RCSID
  380. X  static char RCS[] =
  381. X!     "$Header: makekit.c,v 2.1 88/06/03 11:38:58 rsalz Exp $";
  382. X  #endif    /* RCSID */
  383. X  
  384. X  
  385. X***************
  386. X*** 51,57 ****
  387. X  char    *TEMP;                /* Temporary manifest file    */
  388. X  #ifdef    MSDOS
  389. X  char    *FLST;                /* File with list for shar    */
  390. X! #endif    MSDOS
  391. X  int     ArkCount = 20;            /* Max number of archives    */
  392. X  int     ExcludeIt;            /* Leave out the output file?    */
  393. X  int     Header;            /* Lines of prolog in input    */
  394. X--- 51,57 ----
  395. X  char    *TEMP;                /* Temporary manifest file    */
  396. X  #ifdef    MSDOS
  397. X  char    *FLST;                /* File with list for shar    */
  398. X! #endif    /* MSDOS */
  399. X  int     ArkCount = 20;            /* Max number of archives    */
  400. X  int     ExcludeIt;            /* Leave out the output file?    */
  401. X  int     Header;            /* Lines of prolog in input    */
  402. X***************
  403. X*** 163,171 ****
  404. X      while ((i = getopt(ac, av, "1eh:i:k:n:mo:p:s:t:x")) != EOF)
  405. X      switch (i) {
  406. X      default:
  407. X!         Fprintf(stderr,
  408. X! "usage: makekit -e -s# [-m | -iMANIFEST -oMANIFEST -h2] -nName -tText files..."
  409. X!             );
  410. X          exit(1);
  411. X      case '1':
  412. X          Notkits = TRUE;
  413. X--- 163,171 ----
  414. X      while ((i = getopt(ac, av, "1eh:i:k:n:mo:p:s:t:x")) != EOF)
  415. X      switch (i) {
  416. X      default:
  417. X!         Fprintf(stderr, "usage: makekit %s\n        %s\n",
  418. X!             "[-1] [-e] [-x] [-k #] [-s #[k]] [-n Name] [-t Text]",
  419. X!             "[-p] [-m | -i MANIFEST -o MANIFEST -h 2] [file ...]");
  420. X          exit(1);
  421. X      case '1':
  422. X          Notkits = TRUE;
  423. X***************
  424. X*** 266,272 ****
  425. X          *p++ = '\0';
  426. X  
  427. X      /* Skip <spaces><digits><spaces>; remainder is the file description. */
  428. X!     for (p = Skip(p); *p && isdigit(*p); )
  429. X          p++;
  430. X      t->Text = Skip(p);
  431. X  
  432. X--- 266,272 ----
  433. X          *p++ = '\0';
  434. X  
  435. X      /* Skip <spaces><digits><spaces>; remainder is the file description. */
  436. X!     for (p = Skip(p); *p && isascii(*p) && isdigit(*p); )
  437. X          p++;
  438. X      t->Text = Skip(p);
  439. X  
  440. X*** /tmp/,RCSt1a25265    Fri Jun  3 11:54:14 1988
  441. X--- makekit.man    Fri Jun  3 11:53:08 1988
  442. X***************
  443. X*** 1,5 ****
  444. X  .TH MAKEKIT 1l
  445. X! .\" $Header: makekit.man,v 2.0 88/05/27 13:28:41 rsalz Exp $
  446. X  .SH NAME
  447. X  makekit \- split files up into shell archive packages
  448. X  .SH SYNOPSIS
  449. X--- 1,5 ----
  450. X  .TH MAKEKIT 1l
  451. X! .\" $Header: makekit.man,v 2.1 88/06/03 11:39:05 rsalz Exp $
  452. X  .SH NAME
  453. X  makekit \- split files up into shell archive packages
  454. X  .SH SYNOPSIS
  455. X***************
  456. X*** 9,14 ****
  457. X--- 9,16 ----
  458. X  ] [
  459. X  [
  460. X  .B -e
  461. X+ ] [
  462. X+ .B -x
  463. X  ] [
  464. X  .BI -h\| #
  465. X  ] [
  466. X*** /tmp/,RCSt1a25265    Fri Jun  3 11:54:20 1988
  467. X--- parser.c    Fri Jun  3 11:53:11 1988
  468. X***************
  469. X*** 11,17 ****
  470. X  #include "shar.h"
  471. X  #ifdef    RCSID
  472. X  static char RCS[] =
  473. X!     "$Header: parser.c,v 2.0 88/05/27 13:27:39 rsalz Exp $";
  474. X  #endif    /* RCSID */
  475. X  
  476. X  
  477. X--- 11,17 ----
  478. X  #include "shar.h"
  479. X  #ifdef    RCSID
  480. X  static char RCS[] =
  481. X!     "$Header: parser.c,v 2.1 88/06/03 11:39:11 rsalz Exp $";
  482. X  #endif    /* RCSID */
  483. X  
  484. X  
  485. X***************
  486. X*** 66,72 ****
  487. X  jmp_buf         jEnv;            /* Pop out of main loop        */
  488. X  #endif    MSDOS
  489. X  
  490. X- extern COMTAB     Dispatch[];        /* Defined below...        */
  491. X  static VAR     VarList[MAX_VARS];    /* Our list of variables    */
  492. X  static char     Text[BUFSIZ];        /* Current text line        */
  493. X  static int     LineNum = 1;        /* Current line number        */
  494. X--- 66,71 ----
  495. X***************
  496. X*** 782,788 ****
  497. X      return(!EQ(Expand(av[0]), Expand(av[2])) ? V : !V);
  498. X  
  499. X      /* Testing a file's size? */
  500. X!     if (ac == (av[5] && EQ(av[5], "<") ? 8 : 7) && isdigit(av[0][0])
  501. X       && (EQ(av[1], "-ne") || EQ(av[1], "-eq"))
  502. X       && EQ(av[2], "`") && EQ(av[3], "wc")
  503. X       && EQ(av[4], "-c") && EQ(av[ac - 1], "`")) {
  504. X--- 781,788 ----
  505. X      return(!EQ(Expand(av[0]), Expand(av[2])) ? V : !V);
  506. X  
  507. X      /* Testing a file's size? */
  508. X!     if (ac == (av[5] && EQ(av[5], "<") ? 8 : 7)
  509. X!      && isascii(av[0][0]) && isdigit(av[0][0])
  510. X       && (EQ(av[1], "-ne") || EQ(av[1], "-eq"))
  511. X       && EQ(av[2], "`") && EQ(av[3], "wc")
  512. X       && EQ(av[4], "-c") && EQ(av[ac - 1], "`")) {
  513. X*** /tmp/,RCSt1a25265    Fri Jun  3 11:54:27 1988
  514. X--- shar.c    Fri Jun  3 11:53:15 1988
  515. X***************
  516. X*** 5,11 ****
  517. X  #include "shar.h"
  518. X  #ifdef    RCSID
  519. X  static char RCS[] =
  520. X!     "$Header: shar.c,v 2.0 88/05/27 14:10:47 rsalz Exp $";
  521. X  #endif    /* RCSID */
  522. X  
  523. X  /*
  524. X--- 5,11 ----
  525. X  #include "shar.h"
  526. X  #ifdef    RCSID
  527. X  static char RCS[] =
  528. X!     "$Header: shar.c,v 2.1 88/06/03 11:51:12 rsalz Exp $";
  529. X  #endif    /* RCSID */
  530. X  
  531. X  /*
  532. X***************
  533. X*** 74,84 ****
  534. X      /* Output the file contents. */
  535. X      for (Bads = 0; fgets(buf, BUFSIZ, stdin); )
  536. X          if (buf[0]) {
  537. X          if (buf[0] == 'X' || buf[0] == 'E' || buf[0] == 'F'
  538. X!          || !isalpha(buf[0]))
  539. X              /* Protect non-alpha's, the shar pattern character, the
  540. X               * END_OF_FILE message, and mail "From" lines. */
  541. X              (void)putchar('X');
  542. X          for (s = buf; *s; s++) {
  543. X              if (BADCHAR(*s))
  544. X              Bads++;
  545. X--- 74,89 ----
  546. X      /* Output the file contents. */
  547. X      for (Bads = 0; fgets(buf, BUFSIZ, stdin); )
  548. X          if (buf[0]) {
  549. X+ #ifdef    TOO_FANCY
  550. X          if (buf[0] == 'X' || buf[0] == 'E' || buf[0] == 'F'
  551. X!          || !isascii(buf[0]) || !isalpha(buf[0]))
  552. X              /* Protect non-alpha's, the shar pattern character, the
  553. X               * END_OF_FILE message, and mail "From" lines. */
  554. X              (void)putchar('X');
  555. X+ #else
  556. X+         /* Always put out a leading X. */
  557. X+         (void)putchar('X');
  558. X+ #endif    /* TOO_FANCY */
  559. X          for (s = buf; *s; s++) {
  560. X              if (BADCHAR(*s))
  561. X              Bads++;
  562. X***************
  563. X*** 90,96 ****
  564. X      Printf("END_OF_FILE\n", Name);
  565. X      if (Bads) {
  566. X          Printf(
  567. X!     "echo shar: %d control character%s may be missing from \\\"'%s'\\\"\n",
  568. X             Bads, Bads == 1 ? "" : "s", Name);
  569. X          Fprintf(stderr, "Found %d control char%s in \"'%s'\"\n",
  570. X              Bads, Bads == 1 ? "" : "s", Name);
  571. X--- 95,101 ----
  572. X      Printf("END_OF_FILE\n", Name);
  573. X      if (Bads) {
  574. X          Printf(
  575. X!     "echo shar: %d control character%s may be missing from \\\"'%s'\\\"\n",
  576. X             Bads, Bads == 1 ? "" : "s", Name);
  577. X          Fprintf(stderr, "Found %d control char%s in \"'%s'\"\n",
  578. X              Bads, Bads == 1 ? "" : "s", Name);
  579. X***************
  580. X*** 145,151 ****
  581. X      files[i] = COPY(buff);
  582. X      if (++i == count - 2) {
  583. X          /* Get more space; some systems don't have realloc()... */
  584. X!         for (count += MIN_FILES, temp = NEW(char*, count), j = 0; j < i; j++)
  585. X          temp[j] = files[j];
  586. X          files = temp;
  587. X      }
  588. X--- 150,157 ----
  589. X      files[i] = COPY(buff);
  590. X      if (++i == count - 2) {
  591. X          /* Get more space; some systems don't have realloc()... */
  592. X!         temp = NEW(char*, count);
  593. X!         for (count += MIN_FILES, j = 0; j < i; j++)
  594. X          temp[j] = files[j];
  595. X          files = temp;
  596. X      }
  597. X***************
  598. X*** 158,164 ****
  599. X  }
  600. X  
  601. X  
  602. X- 
  603. X  main(ac, av)
  604. X      int             ac;
  605. X      REGISTER char    *av[];
  606. X--- 164,169 ----
  607. X***************
  608. X*** 181,186 ****
  609. X--- 186,192 ----
  610. X      Knum = 0;
  611. X      Kmax = 0;
  612. X      Trailer = NULL;
  613. X+     Flist = NULL;
  614. X      for (Oops = 0; (i = getopt(ac, av, "be:i:n:o:t:")) != EOF; )
  615. X      switch (i) {
  616. X      default:
  617. X*** /tmp/,RCSt1a25265    Fri Jun  3 11:54:30 1988
  618. X--- shar.h    Fri Jun  3 11:53:18 1988
  619. X***************
  620. X*** 3,9 ****
  621. X  **  If you have to edit this file, then I messed something up, please
  622. X  **  let me know what.
  623. X  **
  624. X! **  $Header: shar.h,v 2.0 88/05/27 13:28:00 rsalz Exp $
  625. X  */
  626. X  
  627. X  #include "config.h"
  628. X--- 3,9 ----
  629. X  **  If you have to edit this file, then I messed something up, please
  630. X  **  let me know what.
  631. X  **
  632. X! **  $Header: shar.h,v 2.1 88/06/03 11:39:28 rsalz Exp $
  633. X  */
  634. X  
  635. X  #include "config.h"
  636. X***************
  637. X*** 41,47 ****
  638. X  #include "ndir.h"
  639. X  #endif    /* IN_NDIR */
  640. X  #ifdef    IN_DIRENT
  641. X! #include "dirent.h"
  642. X  #endif    /* IN_DIRENT */
  643. X  
  644. X  
  645. X--- 41,47 ----
  646. X  #include "ndir.h"
  647. X  #endif    /* IN_NDIR */
  648. X  #ifdef    IN_DIRENT
  649. X! #include <dirent.h>
  650. X  #endif    /* IN_DIRENT */
  651. X  
  652. X  
  653. X***************
  654. X*** 86,92 ****
  655. X  /*
  656. X  **  Macros.
  657. X  */
  658. X! #define BADCHAR(c)    (iscntrl((c)) && !isspace((c)))
  659. X  #define EQ(a, b)    (strcmp((a), (b)) == 0)
  660. X  #define EQn(a, b, n)    (strncmp((a), (b), (n)) == 0)
  661. X  #define PREFIX(a, b)    (EQn((a), (b), sizeof b - 1))
  662. X--- 86,93 ----
  663. X  /*
  664. X  **  Macros.
  665. X  */
  666. X! #define BADCHAR(c)    (!isascii((c)) || (iscntrl((c)) && !isspace((c))))
  667. X! #define HDRCHAR(c)    ((c) == '-' || (c) == '_' || (c) == '.')
  668. X  #define EQ(a, b)    (strcmp((a), (b)) == 0)
  669. X  #define EQn(a, b, n)    (strncmp((a), (b), (n)) == 0)
  670. X  #define PREFIX(a, b)    (EQn((a), (b), sizeof b - 1))
  671. X*** /tmp/,RCSt1a25265    Fri Jun  3 11:54:34 1988
  672. X--- unshar.c    Fri Jun  3 11:53:30 1988
  673. X***************
  674. X*** 6,12 ****
  675. X  #include "shar.h"
  676. X  #ifdef    RCSID
  677. X  static char RCS[] =
  678. X!     "$Header: unshar.c,v 2.0 88/05/27 13:28:13 rsalz Exp $";
  679. X  #endif    /* RCSID */
  680. X  
  681. X  
  682. X--- 6,12 ----
  683. X  #include "shar.h"
  684. X  #ifdef    RCSID
  685. X  static char RCS[] =
  686. X!     "$Header: unshar.c,v 2.1 88/06/03 11:39:33 rsalz Exp $";
  687. X  #endif    /* RCSID */
  688. X  
  689. X  
  690. X***************
  691. X*** 41,47 ****
  692. X      return(FALSE);
  693. X      if (WHITE(*p))
  694. X      return(TRUE);
  695. X!     for (i = 0; *p == '-' || *p == '_' || *p == '.' || isalnum(*p); i++)
  696. X      p++;
  697. X      return(i && *p == ':');
  698. X  }
  699. X--- 41,47 ----
  700. X      return(FALSE);
  701. X      if (WHITE(*p))
  702. X      return(TRUE);
  703. X!     for (i = 0; (isascii(*p) && isalnum(*p)) || HDRCHAR(*p); i++)
  704. X      p++;
  705. X      return(i && *p == ':');
  706. X  }
  707. X***************
  708. X*** 55,61 ****
  709. X  IsSHcomment(p)
  710. X      REGISTER char    *p;
  711. X  {
  712. X!     while (isalpha(*p) || WHITE(*p) || *p == '\n' || *p == ',' || *p == '.')
  713. X      p++;
  714. X      return(*p == '\0');
  715. X  }
  716. X--- 55,62 ----
  717. X  IsSHcomment(p)
  718. X      REGISTER char    *p;
  719. X  {
  720. X!     while (isascii(*p) &&
  721. X!       (isalpha(*p) || WHITE(*p) || *p == '\n' || *p == ',' || *p == '.'))
  722. X      p++;
  723. X      return(*p == '\0');
  724. X  }
  725. X***************
  726. X*** 78,90 ****
  727. X      first = TRUE;
  728. X  again: 
  729. X      while (*p) {
  730. X!     if (!isalpha(*p)) {
  731. X          p++;
  732. X          continue;
  733. X      }
  734. X      while (*p++ == *wd++) {
  735. X          if (*wd == '\0') {
  736. X!         if (!isalpha(*p)) {
  737. X              if (!first)
  738. X              return(TRUE);
  739. X              first = FALSE;
  740. X--- 79,91 ----
  741. X      first = TRUE;
  742. X  again: 
  743. X      while (*p) {
  744. X!     if (!isascii(*p) || !isalpha(*p)) {
  745. X          p++;
  746. X          continue;
  747. X      }
  748. X      while (*p++ == *wd++) {
  749. X          if (*wd == '\0') {
  750. X!         if (!isascii(*p) || !isalpha(*p)) {
  751. X              if (!first)
  752. X              return(TRUE);
  753. X              first = FALSE;
  754. X***************
  755. X*** 94,100 ****
  756. X          break;
  757. X          }
  758. X      }
  759. X!     while (isalpha(*p))
  760. X          p++;
  761. X      wd = first ? wd1 : wd2;
  762. X      }
  763. X--- 95,101 ----
  764. X          break;
  765. X          }
  766. X      }
  767. X!     while (isascii(*p) && isalpha(*p))
  768. X          p++;
  769. X      wd = first ? wd1 : wd2;
  770. X      }
  771. X***************
  772. X*** 139,146 ****
  773. X          p = "C code";
  774. X          else if (PREFIX(buff, "(*"))        /* For vi :-) */
  775. X          p = "PASCAL code";
  776. X!         else if (buff[0] == '.' && isalpha(buff[1]) && isalpha(buff[2])
  777. X!           && !isalpha(buff[3]))
  778. X          p = "TROFF source";
  779. X          else
  780. X          p = NULL;
  781. X--- 140,149 ----
  782. X          p = "C code";
  783. X          else if (PREFIX(buff, "(*"))        /* For vi :-) */
  784. X          p = "PASCAL code";
  785. X!         else if (buff[0] == '.'
  786. X!           && isascii(buff[1]) && isalpha(buff[1])
  787. X!           && isascii(buff[2]) && isalpha(buff[2])
  788. X!           && isascii(buff[3]) && !isalpha(buff[3]))
  789. X          p = "TROFF source";
  790. X          else
  791. X          p = NULL;
  792. X***************
  793. X*** 175,181 ****
  794. X          } while (*buff == '\n');
  795. X  
  796. X          /* If it starts with a comment or lower-case letter we win. */
  797. X!         if (*buff == '#' || *buff == ':' || islower(*buff))
  798. X          return(TRUE);
  799. X  
  800. X          /* The cut message lied. */
  801. X--- 178,185 ----
  802. X          } while (*buff == '\n');
  803. X  
  804. X          /* If it starts with a comment or lower-case letter we win. */
  805. X!         if (*buff == '#' || *buff == ':'
  806. X!          || (isascii(*buff) && islower(*buff)))
  807. X          return(TRUE);
  808. X  
  809. X          /* The cut message lied. */
  810. X*** /dev/null    Fri Jun  3 11:45:01 1988
  811. X--- config.x386    Fri Jun  3 11:52:42 1988
  812. X***************
  813. X*** 0 ****
  814. X--- 1,112 ----
  815. X+ /*
  816. X+ **  Configuration file for shar and friends.
  817. X+ **
  818. X+ **  This config file is for Xenix on a 386.
  819. X+ **  In the Makefile, set DIRLIB=-lx, and tweak the MANDIR and 1 variables.
  820. X+ **
  821. X+ **  $Header: config.x386,v 2.0 88/06/03 11:46:28 rsalz Exp $
  822. X+ */
  823. X+ 
  824. X+ 
  825. X+ /*
  826. X+ **  Higher-level controls for which operating system we're running on.
  827. X+ */
  828. X+ #define UNIX                /* Works            */
  829. X+ /*efine MSDOS                /* Should work            */
  830. X+ /*efine VMS                /* Doesn't work            */
  831. X+ 
  832. X+ 
  833. X+ /*
  834. X+ **  A dense section of one-line compilation controls.  If you're confused,
  835. X+ **  your best bet is to search through the source to see where and how
  836. X+ **  each one of these is used.
  837. X+ */
  838. X+ #define IDX        strchr        /* Maybe strchr?        */
  839. X+ #define RDX        strrchr        /* Maybe strrchr?        */
  840. X+ #define NEED_MKDIR            /* Don't have mkdir(2)?        */
  841. X+ /*efine NEED_QSORT            /* Don't have qsort(3)?        */
  842. X+ /*efine NEED_GETOPT            /* Need local getopt object?    */
  843. X+ #define CAN_POPEN            /* Can invoke file(1) command?    */
  844. X+ /*efine USE_MY_SHELL            /* Don't popen("/bin/sh")?    */
  845. X+ typedef int         sigret_t;    /* What a signal handler returns */
  846. X+ typedef int        *align_t;    /* Worst-case alignment, for lint */
  847. X+ /* typedef long        time_t        /* Needed for non-BSD sites?    */
  848. X+ /* typedef long        off_t        /* Needed for non-BSD sites?    */
  849. X+ /*efine void        int        /* If you don't have void    */
  850. X+ /*efine SYS_WAIT            /* Have <sys/wait.h> and vfork?    */
  851. X+ /*efine USE_SYSTEM            /* Use system(3), not exec(2)?    */
  852. X+ #define USE_SYSERRLIST            /* Have sys_errlist[], sys_nerr? */
  853. X+ #define USE_GETPWUID            /* Use getpwuid(3)?        */
  854. X+ #define DEF_SAVEIT    1        /* Save headers by default?    */
  855. X+ /*efine FMT02d                /* Need "%02.2d", not "%2.2d"?    */
  856. X+ #define MAX_LEVELS    6        /* Levels for findsrc to walk    */
  857. X+ #define THE_TTY        "/dev/tty"    /* Maybe "con:" for MS-DOS?    */
  858. X+ #define RCSID                /* Compile in the RCS strings?    */
  859. X+ #define USERNAME    "USER"        /* Your name, if not in environ    */
  860. X+ #define PTR_SPRINTF            /* Need extern char *sprinf()?    */
  861. X+ /*efine ANSI_HDRS            /* Use <stdlib.h>, etc.?    */
  862. X+ #define REGISTER    register    /* Do you trust your compiler?    */
  863. X+ 
  864. X+ 
  865. X+ /*
  866. X+ **  There are several ways to get current machine name.  Enable just one
  867. X+ **  of one of the following lines.
  868. X+ */
  869. X+ /*efine GETHOSTNAME            /* Use gethostname(2) call    */
  870. X+ #define UNAME                /* Use uname(2) call        */
  871. X+ /*efine UUNAME                /* Invoke "uuname -l"        */
  872. X+ /*efine    WHOAMI                /* Try /etc/whoami & <whoami.h>    */
  873. X+ /*efine HOST        "SITE"        /* If all else fails        */
  874. X+ 
  875. X+ 
  876. X+ /*
  877. X+ **  There are several different ways to get the current working directory.
  878. X+ **  Enable just one of the following lines.
  879. X+ */
  880. X+ /*efine GETWD                /* Use getwd(3) routine        */
  881. X+ #define GETCWD                /* Use getcwd(3) routine    */
  882. X+ /*efine PWDPOPEN            /* Invoke "pwd"            */
  883. X+ /*efine PWDGETENV    "PWD"        /* Get $PWD from environment    */
  884. X+ 
  885. X+ 
  886. X+ /*
  887. X+ **  If you're a notes site, you might have to tweaks these two #define's.
  888. X+ **  If you don't care, then set them equal to something that doesn't
  889. X+ **  start with the comment-begin sequence and they'll be effectively no-ops
  890. X+ **  at the cost of an extra strcmp.  I've also heard of broken MS-DOS
  891. X+ **  compilers that don't ignore slash-star inside comments!  Anyhow, for
  892. X+ **  more details see unshar.c
  893. X+ */
  894. X+ /*efine NOTES1        "/* Written "    /* This is what notes 1.7 uses    */
  895. X+ /*efine NOTES2        "/* ---"    /* This is what notes 1.7 uses    */
  896. X+ #define NOTES1        "$$"        /* This is a don't care        */
  897. X+ #define NOTES2        "$$"        /* This is a don't care        */
  898. X+ 
  899. X+ 
  900. X+ /*
  901. X+ **  The findsrc program uses the readdir() routines to read directories.
  902. X+ **  If your system doesn't have this interface, there are public domain
  903. X+ **  implementations available for Unix from the comp.sources.unix archives,
  904. X+ **  GNU has a VMS one inside EMACS, and this package comes with kits for
  905. X+ **  MS-DOS and the Amiga.  Help save the world and use or write a readdir()
  906. X+ **  package for your system!
  907. X+ */
  908. X+ 
  909. X+ /* Now then, where did I put that header file?   Pick one. */
  910. X+ /*efine IN_SYS_DIR            /* <sys/dir.h>            */
  911. X+ #define IN_SYS_NDIR            /* <sys/ndir.h>            */
  912. X+ /*efine IN_DIR                /* <dir.h>            */
  913. X+ /*efine IN_DIRECT            /* <direct.h>            */
  914. X+ /*efine IN_NDIR                /* "ndir.h"            */
  915. X+ /*efine IN_DIRENT            /* <dirent.h>            */
  916. X+ 
  917. X+ /*  What readdir() returns.  Must be a #define because of #include order. */
  918. X+ #ifdef    IN_DIRENT
  919. X+ #define DIRENTRY    struct dirent
  920. X+ #else
  921. X+ #define DIRENTRY    struct direct
  922. X+ #endif    /* IN_DIRENT */
  923. X+ 
  924. X+ /*
  925. X+ **  Congratulations, you're done!
  926. X+ */
  927. X*** /dev/null    Fri Jun  3 11:45:01 1988
  928. X--- config.sVr3    Fri Jun  3 11:52:40 1988
  929. X***************
  930. X*** 0 ****
  931. X--- 1,112 ----
  932. X+ /*
  933. X+ **  Configuration file for shar and friends.
  934. X+ **
  935. X+ **  This is known to work on Ultrix1.2 and Sun3.4 machines; it may work
  936. X+ **  on other BSD variants, too.
  937. X+ **
  938. X+ **  $Header: config.sVr3,v 2.0 88/06/03 11:45:30 rsalz Exp $
  939. X+ */
  940. X+ 
  941. X+ 
  942. X+ /*
  943. X+ **  Higher-level controls for which operating system we're running on.
  944. X+ */
  945. X+ #define UNIX                /* Works            */
  946. X+ /*efine MSDOS                /* Should work            */
  947. X+ /*efine VMS                /* Doesn't work            */
  948. X+ 
  949. X+ 
  950. X+ /*
  951. X+ **  A dense section of one-line compilation controls.  If you're confused,
  952. X+ **  your best bet is to search through the source to see where and how
  953. X+ **  each one of these is used.
  954. X+ */
  955. X+ #define IDX        strchr        /* Maybe strchr?        */
  956. X+ #define RDX        strrchr        /* Maybe strrchr?        */
  957. X+ /*efine NEED_MKDIR            /* Don't have mkdir(2)?        */
  958. X+ /*efine NEED_QSORT            /* Don't have qsort(3)?        */
  959. X+ /*efine NEED_GETOPT            /* Need local getopt object?    */
  960. X+ #define CAN_POPEN            /* Can invoke file(1) command?    */
  961. X+ /*efine USE_MY_SHELL            /* Don't popen("/bin/sh")?    */
  962. X+ typedef void         sigret_t;    /* What a signal handler returns */
  963. X+ typedef int        *align_t;    /* Worst-case alignment, for lint */
  964. X+ typedef long        time_t;        /* Needed for non-BSD sites?    */
  965. X+ typedef long        off_t;        /* Needed for non-BSD sites?    */
  966. X+ /*efine void        int        /* If you don't have void    */
  967. X+ /*efine SYS_WAIT            /* Have <sys/wait.h> and vfork?    */
  968. X+ /*efine USE_SYSTEM            /* Use system(3), not exec(2)?    */
  969. X+ /*efine USE_SYSERRLIST            /* Have sys_errlist[], sys_nerr? */
  970. X+ #define USE_GETPWUID            /* Use getpwuid(3)?        */
  971. X+ #define DEF_SAVEIT    1        /* Save headers by default?    */
  972. X+ /*efine FMT02d                /* Need "%02.2d", not "%2.2d"?    */
  973. X+ #define MAX_LEVELS    6        /* Levels for findsrc to walk    */
  974. X+ #define THE_TTY        "/dev/tty"    /* Maybe "con:" for MS-DOS?    */
  975. X+ #define RCSID                /* Compile in the RCS strings?    */
  976. X+ #define USERNAME    "USER"        /* Your name, if not in environ    */
  977. X+ /*efine PTR_SPRINTF            /* Need extern char *sprinf()?    */
  978. X+ /*efine ANSI_HDRS            /* Use <stdlib.h>, etc.?    */
  979. X+ #define REGISTER    register    /* Do you trust your compiler?    */
  980. X+ 
  981. X+ 
  982. X+ /*
  983. X+ **  There are several ways to get current machine name.  Enable just one
  984. X+ **  of one of the following lines.
  985. X+ */
  986. X+ /*efine GETHOSTNAME            /* Use gethostname(2) call    */
  987. X+ #define UNAME                /* Use uname(2) call        */
  988. X+ /*efine UUNAME                /* Invoke "uuname -l"        */
  989. X+ /*efine    WHOAMI                /* Try /etc/whoami & <whoami.h>    */
  990. X+ /*efine HOST        "SITE"        /* If all else fails        */
  991. X+ 
  992. X+ 
  993. X+ /*
  994. X+ **  There are several different ways to get the current working directory.
  995. X+ **  Enable just one of the following lines.
  996. X+ */
  997. X+ /*efine GETWD                /* Use getwd(3) routine        */
  998. X+ #define GETCWD                /* Use getcwd(3) routine    */
  999. X+ /*efine PWDPOPEN            /* Invoke "pwd"            */
  1000. X+ /*efine PWDGETENV    "PWD"        /* Get $PWD from environment    */
  1001. X+ 
  1002. X+ 
  1003. X+ /*
  1004. X+ **  If you're a notes site, you might have to tweaks these two #define's.
  1005. X+ **  If you don't care, then set them equal to something that doesn't
  1006. X+ **  start with the comment-begin sequence and they'll be effectively no-ops
  1007. X+ **  at the cost of an extra strcmp.  I've also heard of broken MS-DOS
  1008. X+ **  compilers that don't ignore slash-star inside comments!  Anyhow, for
  1009. X+ **  more details see unshar.c
  1010. X+ */
  1011. X+ /*efine NOTES1        "/* Written "    /* This is what notes 1.7 uses    */
  1012. X+ /*efine NOTES2        "/* ---"    /* This is what notes 1.7 uses    */
  1013. X+ #define NOTES1        "$$"        /* This is a don't care        */
  1014. X+ #define NOTES2        "$$"        /* This is a don't care        */
  1015. X+ 
  1016. X+ 
  1017. X+ /*
  1018. X+ **  The findsrc program uses the readdir() routines to read directories.
  1019. X+ **  If your system doesn't have this interface, there are public domain
  1020. X+ **  implementations available for Unix from the comp.sources.unix archives,
  1021. X+ **  GNU has a VMS one inside EMACS, and this package comes with kits for
  1022. X+ **  MS-DOS and the Amiga.  Help save the world and use or write a readdir()
  1023. X+ **  package for your system!
  1024. X+ */
  1025. X+ 
  1026. X+ /* Now then, where did I put that header file?   Pick one. */
  1027. X+ /*efine IN_SYS_DIR            /* <sys/dir.h>            */
  1028. X+ /*efine IN_SYS_NDIR            /* <sys/ndir.h>            */
  1029. X+ /*efine IN_DIR                /* <dir.h>            */
  1030. X+ /*efine IN_DIRECT            /* <direct.h>            */
  1031. X+ /*efine IN_NDIR                /* "ndir.h"            */
  1032. X+ #define IN_DIRENT            /* <dirent.h>            */
  1033. X+ 
  1034. X+ /*  What readdir() returns.  Must be a #define because of #include order. */
  1035. X+ #ifdef    IN_DIRENT
  1036. X+ #define DIRENTRY    struct dirent
  1037. X+ #else
  1038. X+ #define DIRENTRY    struct direct
  1039. X+ #endif    /* IN_DIRENT */
  1040. X+ 
  1041. X+ /*
  1042. X+ **  Congratulations, you're done!
  1043. X+ */
  1044. END_OF_FILE
  1045. if test 29598 -ne `wc -c <'patch01'`; then
  1046.     echo shar: \"'patch01'\" unpacked with wrong size!
  1047. fi
  1048. # end of 'patch01'
  1049. fi
  1050. echo shar: End of shell archive.
  1051. exit 0
  1052.