home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume22 / undel2 / patch10 / delete.patch10
Text File  |  1990-06-07  |  27KB  |  943 lines

  1. *** /tmp/,RCSt1018872    Fri Jun  8 00:10:39 1990
  2. --- README    Thu Jun  7 22:56:38 1990
  3. ***************
  4. *** 16,34 ****
  5.   
  6.                SUPPORTED PLATFORMS
  7.   
  8. ! I've personally compiled these sources under 4.3BSD on VAXen and IBM
  9. ! RT/PC's, under Mach on the NeXT Machine, under Ultrix on the
  10. ! DECstation 3100, and under SunOS 4.0, and I assume they should compile
  11. ! with minimal trouble on other architectures.  If you make it compile
  12. ! on another platform and you have to make changes, please send me
  13. ! patches.
  14.   
  15.   
  16.                WHAT YOU NEED TO DO
  17.   
  18. ! 1. Compile the com_err library (see below for more details) found in
  19. !    the sub-directory et, and install it if you want to (you'll have to
  20. !    modify the delete Makefile a bit if you don't).
  21.   
  22.   2. Edit the Makefile to fit your site.  See below for details.
  23.   
  24. --- 16,36 ----
  25.   
  26.                SUPPORTED PLATFORMS
  27.   
  28. ! I've personally compiled these sources under Vax 4.3BSD, IBM AOS 4.3,
  29. ! Mach on the NeXT Machine (with the "-bsd" flag to the compiler),
  30. ! Ultrix 3.1 on the DECstation 3100, SunOS 4.0, A/UX, and HP-UX, and I
  31. ! assume they should compile with minimal trouble on other architectures
  32. ! (However, I've been told that there may be some problems compiling on
  33. ! POSIX-compliant architectures; they're being worked on.).  If you make
  34. ! it compile on another platform and you have to make changes, please
  35. ! send me patches.
  36.   
  37.   
  38.                WHAT YOU NEED TO DO
  39.   
  40. ! 1. Compile the com_err library (see below for more details) and
  41. !    install it if you want to (you'll have to modify the delete
  42. !    Makefile a bit if you don't).
  43.   
  44.   2. Edit the Makefile to fit your site.  See below for details.
  45.   
  46. ***************
  47. *** 45,83 ****
  48.   1. Change the install binary directory and install man page directory
  49.      (and possibly man section).
  50.   
  51. ! 2. Change the "-I/usr/include" to point to the et subdirectory if you
  52. !    have not installed the com_err header file in a standard location,
  53. !    or to wherever you have installed it.  Change the COMPILE_ET
  54. !    variable to use et/compile_et if you haven't installed the
  55. !    compile_et utility.  Change the -L/usr/athena/lib flag to point to
  56. !    wherever you have installed the library, or to the et subdirectory
  57. !    if you have not.
  58.   
  59. ! 3. Deal with the AFS_MOUNTPOINTS flag, which specifies whether
  60. !    undelete, expunge and lsdel will check for Andrew File System mount
  61. !    points in addition to standard Unix mount points.
  62.   
  63. !    a. If you undefine it, remove the -I and -L flags that point to AFS
  64. !       includes and libraries, and remove the "-lsys" from the LIBS
  65. !       variable.
  66.   
  67. -    b. If you leave it defined, change the -I and -L flags to point to
  68. -       wherever you keep your AFS includes and libraries.
  69.   
  70.                  COM_ERR LIBRARY
  71.   
  72. ! This is the second release of this package.  Unlike the first release,
  73. ! this release requires (for error-handling) a library called com_err,
  74. ! which was written by members of the MIT Student Information Processing
  75. ! Board (SIPB).  Along with that library comes a utility called
  76. ! compile_et.  The sources to the com_err library and compile_et are
  77. ! included with the sources to the delete package; you should compile
  78. ! them and then either install them in a "standard location" on your
  79. ! machine or modify the delete Makefile so that it knows where they are.
  80. ! The delete Makefile does not compile them by default, since they are
  81. ! already compiled and installed at Athena, so you should compile and
  82. ! install them separately from delete etc.
  83.   
  84.   The files texinfo.tex and com_err.texinfo in the et sources are
  85.   compressed and uuencoded because they have control characters in them.
  86. --- 47,78 ----
  87.   1. Change the install binary directory and install man page directory
  88.      (and possibly man section).
  89.   
  90. ! 2. Change the ETINCS and ETLDFLAGS variables to point to the right
  91. !    place.  Also, change the COMPILE_ET variable to point to a
  92. !    compile_et executable if you haven't installed it somewhere in your
  93. !    search path.
  94.   
  95. ! 3. If your system is SYSV-like (e.g. it uses strchr and strrchr
  96. !    instead of index and rindex, or it has memcpy and doesn't have
  97. !    bcopy), and your compile doesn't define the symbol SYSV
  98. !    automatically, then put "-DSYSV" in the DEFINES variable.
  99.   
  100. ! 4. You probably won't want to include AFS support, in which case you
  101. !    should empty all the variables starting with "AFS".  If you do want
  102. !    to support AFS, then set the variables appropriately.
  103.   
  104.   
  105.                  COM_ERR LIBRARY
  106.   
  107. ! In order to compile delete, you need to get your hands on the com_err
  108. ! package, which was written by members of the MIT Student Information
  109. ! Processing Board (SIPB); it should be archived in the same place
  110. ! delete is.  You should compile the library and compile_et utility that
  111. ! comes with it and then either install them in a "standard location" on
  112. ! your machine or modify the delete Makefile so that it knows where they
  113. ! are.  The delete Makefile does not compile them by default, since they
  114. ! are already compiled and installed at Athena, so you should compile
  115. ! and install them separately from delete etc.
  116.   
  117.   The files texinfo.tex and com_err.texinfo in the et sources are
  118.   compressed and uuencoded because they have control characters in them.
  119. ***************
  120. *** 85,116 ****
  121.   of them is necessary for just building the library and using it to
  122.   build delete et al -- they are just documentation about the library.
  123.   
  124. - The version of the com_err library I've included here is "in flux" --
  125. - its authors tell me that several enhancements are planned for the near
  126. - future.  When the library is worked into a more final form, it will
  127. - probably be distributed (to comp.sources.unix, etc.) separately from
  128. - delete.
  129.   
  130.                    FINAL NOTES
  131. - The final patch level used for the first release of this package was
  132. - patch level 2.  Since this is a whole new release, and there were some
  133. - unofficial patches here and there during the life of the first
  134. - release, I upped the patch level to 5 for the first distribution of
  135. - the second release of the delete package.
  136. - There were NO REAL PATCHES numbered 3, 4, or 5 -- I simply chose to
  137. - jump from 2 to 5 when issuing a new release.  Therefore, if you have
  138. - delete sources with a patch level less than 5, you will need to get a
  139. - whole new copy of the sources.
  140. - In other words, treat patch level 5 as patch level 0 for all intents
  141. - and purposes (gee, tha sounds stupid, but you get the idea :-).  See
  142. - the file PATCHLEVEL in the sources to find out what patch level of the
  143. - sources you currently have in your position (if you're reading this
  144. - README file out of a source distribution, you almost definitely have
  145. - patch level 6 or later).
  146.   
  147.   As usual, suggestions and bug fixes are always welcomed.
  148.   
  149. --- 80,87 ----
  150. *** /tmp/,RCSt1018879    Fri Jun  8 00:10:46 1990
  151. --- Makefile    Thu Jun  7 23:37:59 1990
  152. ***************
  153. *** 5,11 ****
  154.   #
  155.   #     $Source: /afs/athena.mit.edu/user/j/jik/src/delete/RCS/Makefile,v $
  156.   #     $Author: jik $
  157. ! #     $Header: /afs/athena.mit.edu/user/j/jik/src/delete/RCS/Makefile,v 1.17 89/12/20 15:14:34 jik Exp $
  158.   #
  159.   
  160.   DESTDIR=
  161. --- 5,11 ----
  162.   #
  163.   #     $Source: /afs/athena.mit.edu/user/j/jik/src/delete/RCS/Makefile,v $
  164.   #     $Author: jik $
  165. ! #     $Header: /afs/athena.mit.edu/user/j/jik/src/delete/RCS/Makefile,v 1.22 90/06/07 23:36:17 jik Exp $
  166.   #
  167.   
  168.   DESTDIR=
  169. ***************
  170. *** 16,30 ****
  171.   CC=         cc
  172.   COMPILE_ET=     compile_et
  173.   LINT=         lint
  174. ! DEFINES=    -DAFS_MOUNTPOINTS
  175. ! INCLUDES=    -I/usr/include\
  176. !         -I/afs/athena.mit.edu/astaff/project/afsdev/build/$(MACHINE)/include
  177.   CFLAGS=     -O $(INCLUDES) $(DEFINES) $(CDEBUGFLAGS)
  178. ! LDFLAGS=    -L/usr/athena/lib\
  179. !         -L/afs/athena.mit.edu/astaff/project/afsdev/build/$(MACHINE)/lib/afs
  180. ! LIBS=         -lcom_err -lsys
  181. ! LINTFLAGS=    $(DEFINES) $(INCLUDES) $(CDEBUGFLAGS) -u
  182.   LINTLIBS=    
  183.   SRCS=         delete.c undelete.c directories.c pattern.c util.c\
  184.           expunge.c lsdel.c col.c shell_regexp.c\
  185.           errors.c stack.c
  186. --- 16,55 ----
  187.   CC=         cc
  188.   COMPILE_ET=     compile_et
  189.   LINT=         lint
  190. ! DEFINES=    $(AFSDEFINES)
  191. ! # These variables apply only if you want this program to recognize
  192. ! # Andrew File System mount points.  If you don't want to support AFS,
  193. ! # then set all the variables starting with "AFS" to nothing.
  194. ! AFSBLD=        bld
  195. ! AFSINC=        /afs/athena.mit.edu/astaff/project/afsdev/sandbox/$(AFSBLD)/dest/include
  196. ! AFSLIB=        /afs/athena.mit.edu/astaff/project/afsdev/sandbox/$(AFSBLD)/dest/lib
  197. ! AFSINCS=    -I$(AFSINC)
  198. ! AFSLDFLAGS=    -L$(AFSLIB) -L$(AFSLIB)/afs
  199. ! AFSLIBS=    -lsys -lrx -llwp $(AFSLIB)/afs/util.a
  200. ! AFSDEFINES=    -DAFS_MOUNTPOINTS
  201. ! # ETINCS is a -I flag pointing to the directory in which the et header
  202. ! # files are stored. 
  203. ! # ETLDFLAGS is a -L flag pointing to the directory where the et
  204. ! # library is stored.
  205. ! # ETLIBS lists the et libraries we want to link against
  206. ! ETINCS=        -I/usr/include
  207. ! ETLDFLAGS=    -L/usr/athena/lib
  208. ! ETLIBS=        -lcom_err
  209. ! # You probably won't have to edit anything below this line.
  210. ! INCLUDES=    $(ETINCS) $(AFSINCS)
  211. ! LDFLAGS=    $(ETLDFLAGS) $(AFSLDFLAGS) 
  212. ! LIBS=         $(ETLIBS) $(AFSLIBS)
  213.   CFLAGS=     -O $(INCLUDES) $(DEFINES) $(CDEBUGFLAGS)
  214. ! LINTFLAGS=    -u $(INCLUDES) $(DEFINES) $(CDEBUGFLAGS)
  215.   LINTLIBS=    
  216.   SRCS=         delete.c undelete.c directories.c pattern.c util.c\
  217.           expunge.c lsdel.c col.c shell_regexp.c\
  218.           errors.c stack.c
  219. ***************
  220. *** 37,48 ****
  221.   MANS=         man1/delete.1 man1/expunge.1 man1/lsdel.1 man1/purge.1\
  222.           man1/undelete.1
  223.   
  224. ! ETLIBSRCS=    et/Makefile et/com_err.3 et/compile_et.1\
  225. !         et/com_err.texinfo.Z.uu et/error_table.y et/et_lex.lex.l\
  226. !         et/texinfo.tex.Z.uu et/*.c et/*.h et/*.et
  227. ! ARCHIVE=    README Makefile PATCHLEVEL $(SRCS) $(INCS) $(ETSRCS)\
  228. !         $(MANS) 
  229. ! ARCHIVEDIRS=     man1 et et/profiled
  230.   
  231.   DELETEOBJS=     delete.o util.o delete_errs.o errors.o
  232.   UNDELETEOBJS=     undelete.o directories.o util.o pattern.o\
  233. --- 62,70 ----
  234.   MANS=         man1/delete.1 man1/expunge.1 man1/lsdel.1 man1/purge.1\
  235.           man1/undelete.1
  236.   
  237. ! ARCHIVE=    README Makefile PATCHLEVEL $(SRCS) $(INCS) $(MANS)\
  238. !         $(ETSRCS)
  239. ! ARCHIVEDIRS=     man1
  240.   
  241.   DELETEOBJS=     delete.o util.o delete_errs.o errors.o
  242.   UNDELETEOBJS=     undelete.o directories.o util.o pattern.o\
  243. ***************
  244. *** 138,144 ****
  245.       tar cvf - $(ARCHIVE) $(ETLIBSRCS) | compress > delete.tar.Z
  246.   
  247.   shar: $(ARCHIVE)
  248. !     makekit -oMANIFEST -h2 MANIFEST $(ARCHIVEDIRS) $(ARCHIVE) $(ETLIBSRCS)
  249.   
  250.   patch: $(ARCHIVE)
  251.       makepatch $(ARCHIVE)
  252. --- 160,166 ----
  253.       tar cvf - $(ARCHIVE) $(ETLIBSRCS) | compress > delete.tar.Z
  254.   
  255.   shar: $(ARCHIVE)
  256. !     makekit -oMANIFEST $(ARCHIVEDIRS) $(ARCHIVE) $(ETLIBSRCS)
  257.   
  258.   patch: $(ARCHIVE)
  259.       makepatch $(ARCHIVE)
  260. *** /tmp/,RCSt1018886    Fri Jun  8 00:10:52 1990
  261. --- PATCHLEVEL    Fri Jun  8 00:09:29 1990
  262. ***************
  263. *** 1 ****
  264. ! 9
  265. --- 1 ----
  266. ! 10
  267. *** /tmp/,RCSt1018893    Fri Jun  8 00:10:58 1990
  268. --- delete.c    Thu Jun  7 19:17:25 1990
  269. ***************
  270. *** 11,17 ****
  271.    */
  272.   
  273.   #if (!defined(lint) && !defined(SABER))
  274. !      static char rcsid_delete_c[] = "$Header: /afs/athena.mit.edu/user/j/jik/src/delete/RCS/delete.c,v 1.21 89/12/15 04:39:22 jik Exp $";
  275.   #endif
  276.   
  277.   #include <sys/types.h>
  278. --- 11,17 ----
  279.    */
  280.   
  281.   #if (!defined(lint) && !defined(SABER))
  282. !      static char rcsid_delete_c[] = "$Header: /afs/athena.mit.edu/user/j/jik/src/delete/RCS/delete.c,v 1.22 90/06/06 19:06:17 jik Exp $";
  283.   #endif
  284.   
  285.   #include <sys/types.h>
  286. ***************
  287. *** 18,24 ****
  288. --- 18,30 ----
  289.   #include <stdio.h>
  290.   #include <sys/stat.h>
  291.   #include <sys/dir.h>
  292. + #ifdef SYSV
  293. + #include <string.h>
  294. + #define index strchr
  295. + #define rindex strrchr
  296. + #else
  297.   #include <strings.h>
  298. + #endif /* SYSV */
  299.   #include <sys/param.h>
  300.   #include <sys/file.h>
  301.   #include <errno.h>
  302. *** /tmp/,RCSt1018900    Fri Jun  8 00:11:04 1990
  303. --- undelete.c    Thu Jun  7 19:17:41 1990
  304. ***************
  305. *** 11,17 ****
  306.    */
  307.   
  308.   #if (!defined(lint) && !defined(SABER))
  309. !      static char rcsid_undelete_c[] = "$Header: /afs/athena.mit.edu/user/j/jik/src/delete/RCS/undelete.c,v 1.19 89/12/15 04:39:31 jik Exp $";
  310.   #endif
  311.   
  312.   #include <stdio.h>
  313. --- 11,17 ----
  314.    */
  315.   
  316.   #if (!defined(lint) && !defined(SABER))
  317. !      static char rcsid_undelete_c[] = "$Header: /afs/athena.mit.edu/user/j/jik/src/delete/RCS/undelete.c,v 1.20 90/06/06 19:06:43 jik Exp $";
  318.   #endif
  319.   
  320.   #include <stdio.h>
  321. ***************
  322. *** 18,24 ****
  323. --- 18,30 ----
  324.   #include <sys/types.h>
  325.   #include <sys/dir.h>
  326.   #include <sys/param.h>
  327. + #ifdef SYSV
  328. + #include <string.h>
  329. + #define index strchr
  330. + #define rindex strrchr
  331. + #else
  332.   #include <strings.h>
  333. + #endif /* SYSV */
  334.   #include <sys/stat.h>
  335.   #include <com_err.h>
  336.   #include <errno.h>
  337. *** /tmp/,RCSt1018907    Fri Jun  8 00:11:10 1990
  338. --- directories.c    Thu Jun  7 19:17:27 1990
  339. ***************
  340. *** 11,17 ****
  341.    */
  342.   
  343.   #if !defined(lint) && !defined(SABER)
  344. !      static char rcsid_directories_c[] = "$Header: /afs/athena.mit.edu/user/j/jik/src/delete/RCS/directories.c,v 1.15 89/11/22 21:32:24 jik Exp $";
  345.   #endif
  346.   
  347.   #include <stdio.h>
  348. --- 11,17 ----
  349.    */
  350.   
  351.   #if !defined(lint) && !defined(SABER)
  352. !      static char rcsid_directories_c[] = "$Header: /afs/athena.mit.edu/user/j/jik/src/delete/RCS/directories.c,v 1.16 90/06/06 19:06:24 jik Exp $";
  353.   #endif
  354.   
  355.   #include <stdio.h>
  356. ***************
  357. *** 19,25 ****
  358. --- 19,31 ----
  359.   #include <sys/stat.h>
  360.   #include <sys/param.h>
  361.   #include <sys/dir.h>
  362. + #ifdef SYSV
  363. + #include <string.h>
  364. + #define index strchr
  365. + #define rindex strrchr
  366. + #else
  367.   #include <strings.h>
  368. + #endif /* SYSV */
  369.   #include <errno.h>
  370.   #include <com_err.h>
  371.   #include "delete_errs.h"
  372. *** /tmp/,RCSt1018914    Fri Jun  8 00:11:18 1990
  373. --- pattern.c    Thu Jun  7 22:33:55 1990
  374. ***************
  375. *** 11,17 ****
  376.    */
  377.   
  378.   #if (!defined(lint) && !defined(SABER))
  379. !      static char rcsid_pattern_c[] = "$Header: /afs/athena.mit.edu/user/j/jik/src/delete/RCS/pattern.c,v 1.16 90/01/11 04:11:58 jik Exp $";
  380.   #endif
  381.   
  382.   #include <stdio.h>
  383. --- 11,17 ----
  384.    */
  385.   
  386.   #if (!defined(lint) && !defined(SABER))
  387. !      static char rcsid_pattern_c[] = "$Header: /afs/athena.mit.edu/user/j/jik/src/delete/RCS/pattern.c,v 1.18 90/06/07 22:33:45 jik Exp $";
  388.   #endif
  389.   
  390.   #include <stdio.h>
  391. ***************
  392. *** 18,24 ****
  393. --- 18,30 ----
  394.   #include <sys/types.h>
  395.   #include <sys/dir.h>
  396.   #include <sys/param.h>
  397. + #ifdef SYSV
  398. + #include <string.h>
  399. + #define index strchr
  400. + #define rindex strrchr
  401. + #else
  402.   #include <strings.h>
  403. + #endif /* SYSV */
  404.   #include <sys/stat.h>
  405.   #include <errno.h>
  406.   #include <com_err.h>
  407. ***************
  408. *** 410,415 ****
  409. --- 416,424 ----
  410.        char first[MAXNAMLEN], rest[MAXPATHLEN];
  411.        int retval;
  412.        int strsize;
  413. + #ifdef PATTERN_DEBUG
  414. +      int j;
  415. + #endif
  416.        
  417.   #ifdef DEBUG
  418.        printf("do_match: looking for %s\n", name);
  419. ***************
  420. *** 429,434 ****
  421. --- 438,446 ----
  422.        if (! *found) {
  423.         set_error(errno);
  424.         error("Malloc");
  425. + #ifdef PATTERN_DEBUG
  426. +       fprintf(stderr, "do_match: return 1.\n");
  427. + #endif
  428.         return error_code;
  429.        }
  430.        *num_found = 0;
  431. ***************
  432. *** 437,442 ****
  433. --- 449,457 ----
  434.        if (! dirp) {
  435.         set_error(errno);
  436.         error(base);
  437. + #ifdef PATTERN_DEBUG
  438. +       fprintf(stderr, "do_match: return 2.\n");
  439. + #endif
  440.         return error_code;
  441.        }
  442.        (void) strcpy(first, firstpart(name, rest));
  443. ***************
  444. *** 445,453 ****
  445. --- 460,474 ----
  446.         if (retval) {
  447.              error("add_str");
  448.              (void) popall();
  449. + #ifdef PATTERN_DEBUG
  450. +            fprintf(stderr, "do_match: return 3.\n");
  451. + #endif
  452.              return retval;
  453.         }
  454.         (*num_found)++;
  455. + #ifdef PATTERN_DEBUG
  456. +       fprintf(stderr, "do_match: return 4.\n");
  457. + #endif
  458.         return 0;
  459.        }
  460.        
  461. ***************
  462. *** 456,461 ****
  463. --- 477,486 ----
  464.         if (! dp) goto updir;
  465.   
  466.         retval = reg_cmp(first, dp->d_name);
  467. + #ifdef PATTERN_DEBUG
  468. +     fprintf(stderr, "do_match: comparing %s to %s returns %d.\n",
  469. +         first, dp->d_name, retval);
  470. + #endif
  471.         if (retval < 0) {
  472.              error("reg_cmp");
  473.              goto updir;
  474. ***************
  475. *** 465,470 ****
  476. --- 490,500 ----
  477.   
  478.         if (is_deleted(dp->d_name) && match_deleted) {
  479.              retval = reg_cmp(first, &dp->d_name[2]);
  480. + #ifdef PATTERN_DEBUG
  481. +            fprintf(stderr,
  482. +                "do_match: deleted compare of %s to %s returns %d.\n",
  483. +                first, &dp->d_name[2], retval);
  484. + #endif
  485.              if (retval < 0) {
  486.               error("reg_cmp");
  487.               goto updir;
  488. ***************
  489. *** 479,490 ****
  490. --- 509,529 ----
  491.              continue;
  492.   
  493.        downdir:
  494. + #ifdef PATTERN_DEBUG
  495. +       fprintf(stderr, "do_match: downdir\n");
  496. + #endif
  497.         retval = push(&dirp, sizeof(DIR *));
  498.         if (retval) {
  499.              error("push");
  500.              (void) popall();
  501. + #ifdef PATTERN_DEBUG
  502. +            fprintf(stderr, "do_match: return 5.\n");
  503. + #endif
  504.              return retval;
  505.         }
  506. + #ifdef PATTERN_DEBUG
  507. +       fprintf(stderr, "do_match: pushing %s, %s, %s\n", first, rest, base);
  508. + #endif
  509.         string_push(first);
  510.         string_push(rest);
  511.         string_push(base);
  512. ***************
  513. *** 497,502 ****
  514. --- 536,544 ----
  515.                if (retval) {
  516.                     error("add_str");
  517.                     (void) popall();
  518. + #ifdef PATTERN_DEBUG
  519. +                   fprintf(stderr, "do_match: return 6.\n");
  520. + #endif
  521.                     return retval;
  522.                }
  523.                (*num_found)++;
  524. ***************
  525. *** 507,512 ****
  526. --- 549,557 ----
  527.               if (retval) {
  528.                error("add_str");
  529.                (void) popall();
  530. + #ifdef PATTERN_DEBUG
  531. +              fprintf(stderr, "do_match: return 7.\n");
  532. + #endif
  533.                return retval;
  534.               }
  535.               (*num_found)++;
  536. ***************
  537. *** 514,519 ****
  538. --- 559,568 ----
  539.              string_pop(base);
  540.              string_pop(rest);
  541.              string_pop(first);
  542. + #ifdef PATTERN_DEBUG
  543. +            fprintf(stderr, "do_match: popped %s, %s, %s\n", first,
  544. +                rest, base);
  545. + #endif
  546.              (void) pop(&dirp, sizeof(DIR *));
  547.              continue;
  548.         }
  549. ***************
  550. *** 527,532 ****
  551. --- 576,585 ----
  552.              string_pop(base);
  553.              string_pop(rest);
  554.              string_pop(first);
  555. + #ifdef PATTERN_DEBUG
  556. +            fprintf(stderr, "do_match: popped %s, %s, %s\n", first,
  557. +                rest, base);
  558. + #endif
  559.              (void) pop(&dirp, sizeof(DIR *));
  560.              continue;
  561.         }
  562. ***************
  563. *** 534,555 ****
  564. --- 587,631 ----
  565.              continue;
  566.   
  567.        updir:
  568. + #ifdef PATTERN_DEBUG
  569. +       fprintf(stderr, "do_match: updir\n");
  570. + #endif
  571.         closedir(dirp);
  572.         string_pop(base);
  573. + #ifdef PATTERN_DEBUG
  574. +       fprintf(stderr, "do_match: popped %s\n", base);
  575. + #endif
  576.         if (retval) {
  577.              if (retval != STACK_EMPTY) {
  578.               error("pop");
  579.               (void) popall();
  580. + #ifdef PATTERN_DEBUG
  581. +             fprintf(stderr, "do_match: return 8.\n");
  582. + #endif
  583.               return retval;
  584.              }
  585. + #ifdef PATTERN_DEBUG
  586. +            fprintf(stderr, "Returning %d word%s from do_match:\n",
  587. +                *num_found,
  588. +                *num_found == 1 ? "" : "s");
  589. +            for (j = 0; j < *num_found; j++)
  590. +             fprintf(stderr, "\t%s\n", (*found)[j]);
  591. +            fprintf(stderr, "do_match: return 9.\n");
  592. + #endif
  593.              return 0;
  594.         }
  595.         string_pop(rest);
  596.         string_pop(first);
  597. + #ifdef PATTERN_DEBUG
  598. +       fprintf(stderr, "do_match: popped %s, %s\n", rest, first);
  599. + #endif
  600.         retval = pop(&dirp, sizeof(DIR *));
  601.         if (retval) {
  602.              error("pop");
  603.              (void) popall();
  604. + #ifdef PATTERN_DEBUG
  605. +            fprintf(stderr, "do_match: return 10.\n");
  606. + #endif
  607.              return retval;
  608.         }
  609.         continue;
  610. *** /tmp/,RCSt1018921    Fri Jun  8 00:11:28 1990
  611. --- util.c    Thu Jun  7 19:17:42 1990
  612. ***************
  613. *** 11,25 ****
  614.    */
  615.   
  616.   #if (!defined(lint) && !defined(SABER))
  617. !      static char rcsid_util_c[] = "$Header: /afs/athena.mit.edu/user/j/jik/src/delete/RCS/util.c,v 1.15 90/01/11 03:47:11 jik Exp $";
  618.   #endif
  619.   
  620.   #include <stdio.h>
  621.   #include <sys/param.h>
  622.   #include <sys/types.h>
  623.   #include <sys/stat.h>
  624.   #include <sys/dir.h>
  625.   #include <strings.h>
  626.   #include <pwd.h>
  627.   #include <errno.h>
  628.   #ifdef AFS_MOUNTPOINTS
  629. --- 11,34 ----
  630.    */
  631.   
  632.   #if (!defined(lint) && !defined(SABER))
  633. !      static char rcsid_util_c[] = "$Header: /afs/athena.mit.edu/user/j/jik/src/delete/RCS/util.c,v 1.17 90/06/07 13:05:30 jik Exp $";
  634.   #endif
  635.   
  636.   #include <stdio.h>
  637.   #include <sys/param.h>
  638.   #include <sys/types.h>
  639. + #ifdef SYSV /* SYSV doesn't define uid_t */
  640. + typedef unsigned short uid_t;
  641. + #endif
  642.   #include <sys/stat.h>
  643.   #include <sys/dir.h>
  644. + #ifdef SYSV
  645. + #include <string.h>
  646. + #define index strchr
  647. + #define rindex strrchr
  648. + #else
  649.   #include <strings.h>
  650. + #endif /* SYSV */
  651.   #include <pwd.h>
  652.   #include <errno.h>
  653.   #ifdef AFS_MOUNTPOINTS
  654. *** /tmp/,RCSt1018928    Fri Jun  8 00:11:36 1990
  655. --- expunge.c    Thu Jun  7 19:17:30 1990
  656. ***************
  657. *** 11,17 ****
  658.    */
  659.   
  660.   #if (!defined(lint) && !defined(SABER))
  661. !      static char rcsid_expunge_c[] = "$Header: /afs/athena.mit.edu/user/j/jik/src/delete/RCS/expunge.c,v 1.13 89/12/28 14:45:15 jik Exp $";
  662.   #endif
  663.   
  664.   #include <stdio.h>
  665. --- 11,17 ----
  666.    */
  667.   
  668.   #if (!defined(lint) && !defined(SABER))
  669. !      static char rcsid_expunge_c[] = "$Header: /afs/athena.mit.edu/user/j/jik/src/delete/RCS/expunge.c,v 1.14 90/06/06 19:06:29 jik Exp $";
  670.   #endif
  671.   
  672.   #include <stdio.h>
  673. ***************
  674. *** 19,25 ****
  675. --- 19,31 ----
  676.   #include <sys/time.h>
  677.   #include <sys/dir.h>
  678.   #include <sys/param.h>
  679. + #ifdef SYSV
  680. + #include <string.h>
  681. + #define index strchr
  682. + #define rindex strrchr
  683. + #else
  684.   #include <strings.h>
  685. + #endif /* SYSV */
  686.   #include <sys/stat.h>
  687.   #include <com_err.h>
  688.   #include <errno.h>
  689. *** /tmp/,RCSt1018935    Fri Jun  8 00:11:43 1990
  690. --- lsdel.c    Thu Jun  7 22:31:48 1990
  691. ***************
  692. *** 11,17 ****
  693.    */
  694.   
  695.   #if (!defined(lint) && !defined(SABER))
  696. !      static char rcsid_lsdel_c[] = "$Header: /afs/athena.mit.edu/user/j/jik/src/delete/RCS/lsdel.c,v 1.9 89/11/22 21:31:08 jik Exp $";
  697.   #endif
  698.   
  699.   #include <stdio.h>
  700. --- 11,17 ----
  701.    */
  702.   
  703.   #if (!defined(lint) && !defined(SABER))
  704. !      static char rcsid_lsdel_c[] = "$Header: /afs/athena.mit.edu/user/j/jik/src/delete/RCS/lsdel.c,v 1.11 90/06/07 22:31:31 jik Exp $";
  705.   #endif
  706.   
  707.   #include <stdio.h>
  708. ***************
  709. *** 19,25 ****
  710. --- 19,34 ----
  711.   #include <sys/dir.h>
  712.   #include <sys/param.h>
  713.   #include <sys/stat.h>
  714. + #ifdef SYSV
  715. + #include <string.h>
  716. + #define index strchr
  717. + #define rindex strrchr
  718. + #else
  719.   #include <strings.h>
  720. + #endif /* SYSV */
  721. + #ifdef _AUX_SOURCE
  722. + extern char *strcmp();
  723. + #endif
  724.   #include <errno.h>
  725.   #include <com_err.h>
  726.   #include "col.h"
  727. *** /tmp/,RCSt1018942    Fri Jun  8 00:11:51 1990
  728. --- col.c    Thu Jun  7 19:17:24 1990
  729. ***************
  730. *** 11,17 ****
  731.    */
  732.   
  733.   #if (!defined(lint) && !defined(SABER))
  734. !      static char rcsid_col_c[] = "$Header: /afs/athena.mit.edu/user/j/jik/src/delete/RCS/col.c,v 1.6 89/11/22 21:24:21 jik Exp $";
  735.   #endif
  736.   
  737.   /*
  738. --- 11,17 ----
  739.    */
  740.   
  741.   #if (!defined(lint) && !defined(SABER))
  742. !      static char rcsid_col_c[] = "$Header: /afs/athena.mit.edu/user/j/jik/src/delete/RCS/col.c,v 1.7 90/06/06 19:05:56 jik Exp $";
  743.   #endif
  744.   
  745.   /*
  746. ***************
  747. *** 21,27 ****
  748. --- 21,33 ----
  749.    */
  750.   
  751.   #include <stdio.h>
  752. + #ifdef SYSV
  753. + #include <string.h>
  754. + #define index strchr
  755. + #define rindex strrchr
  756. + #else
  757.   #include <strings.h>
  758. + #endif /* SYSV */
  759.   #include "errors.h"
  760.   #include "delete_errs.h"
  761.   #include "col.h"
  762. *** /tmp/,RCSt1018963    Fri Jun  8 00:12:07 1990
  763. --- stack.c    Thu Jun  7 22:35:00 1990
  764. ***************
  765. *** 11,17 ****
  766.    */
  767.   
  768.   #if (!defined(lint) && !defined(SABER))
  769. !      static char rcsid_stack_c[] = "$Header: /afs/athena.mit.edu/user/j/jik/src/delete/RCS/stack.c,v 1.5 89/12/11 03:32:37 jik Exp $";
  770.   #endif
  771.   
  772.   #include <sys/types.h>
  773. --- 11,17 ----
  774.    */
  775.   
  776.   #if (!defined(lint) && !defined(SABER))
  777. !      static char rcsid_stack_c[] = "$Header: /afs/athena.mit.edu/user/j/jik/src/delete/RCS/stack.c,v 1.7 90/06/07 22:34:48 jik Exp $";
  778.   #endif
  779.   
  780.   #include <sys/types.h>
  781. ***************
  782. *** 36,42 ****
  783.   {
  784.        static caddr_t stack = (caddr_t) NULL;
  785.        static int size = 0, count = 0;
  786.        switch (op) {
  787.        case EMPTY_STACK:
  788.         if (size) {
  789. --- 36,42 ----
  790.   {
  791.        static caddr_t stack = (caddr_t) NULL;
  792.        static int size = 0, count = 0;
  793. !      
  794.        switch (op) {
  795.        case EMPTY_STACK:
  796.         if (size) {
  797. ***************
  798. *** 44,53 ****
  799.              stack = (caddr_t) NULL;
  800.              size = count = 0;
  801.         }
  802.         return 0;
  803.        case STACK_PUSH:
  804. !       if (bytes == 0)
  805.              return 0;
  806.         if (size - count < bytes) {
  807.              do
  808.               size += STACK_INC;
  809. --- 44,61 ----
  810.              stack = (caddr_t) NULL;
  811.              size = count = 0;
  812.         }
  813. + #ifdef STACK_DEBUG
  814. +       fprintf(stderr, "dostack: return 1 (EMPTY_STACK).\n");
  815. + #endif
  816.         return 0;
  817.        case STACK_PUSH:
  818. !       if (bytes == 0) {
  819. ! #ifdef STACK_DEBUG
  820. !            fprintf(stderr, "Pushing 0 bytes at %d offset.\n", count);
  821. !            fprintf(stderr, "dostack: return 2 (STACK_PUSH).\n");
  822. ! #endif
  823.              return 0;
  824. +       }
  825.         if (size - count < bytes) {
  826.              do
  827.               size += STACK_INC;
  828. ***************
  829. *** 59,75 ****
  830.               size = count = 0;
  831.               set_error(errno);
  832.               error("Malloc");
  833.               return error_code;
  834.              }
  835.         }
  836.         bcopy(data, stack + count, bytes);
  837.         count += bytes;
  838.         return 0;
  839.        case STACK_POP:
  840. !       if (bytes == 0)
  841.              return 0;
  842.         if (count == 0) {
  843.              set_status(STACK_EMPTY);
  844.              return error_code;
  845.         }
  846.         else {
  847. --- 67,104 ----
  848.               size = count = 0;
  849.               set_error(errno);
  850.               error("Malloc");
  851. + #ifdef STACK_DEBUG
  852. +             fprintf(stderr, "dostack: return 3 (STACK_PUSH).\n");
  853. + #endif
  854.               return error_code;
  855.              }
  856.         }
  857. + #ifdef STACK_DEBUG
  858. +       fprintf(stderr, "Pushing %d bytes at %d offset.\n", bytes, count);
  859. + #endif
  860. + #if defined(SYSV) || (defined(__STDC__) && !defined(__HIGHC__))
  861. +       memcpy(stack + count, data, bytes);
  862. + #else
  863.         bcopy(data, stack + count, bytes);
  864. + #endif
  865.         count += bytes;
  866. + #ifdef STACK_DEBUG
  867. +       fprintf(stderr, "dostack: return 4 (STACK_PUSH).\n");
  868. + #endif
  869.         return 0;
  870.        case STACK_POP:
  871. !       if (bytes == 0) {
  872. ! #ifdef STACK_DEBUG
  873. !            fprintf(stderr, "Popping 0 bytes at %d offset.\n", count);
  874. !            fprintf(stderr, "dostack: return 5 (STACK_POP).\n");
  875. ! #endif
  876.              return 0;
  877. +       }
  878.         if (count == 0) {
  879.              set_status(STACK_EMPTY);
  880. + #ifdef STACK_DEBUG
  881. +            fprintf(stderr, "dostack: return 6 (STACK_POP).\n");
  882. + #endif
  883.              return error_code;
  884.         }
  885.         else {
  886. ***************
  887. *** 76,82 ****
  888. --- 105,119 ----
  889.              int newblocks, newsize;
  890.   
  891.              count -= bytes;
  892. + #ifdef STACK_DEBUG
  893. +            fprintf(stderr, "Popping %d bytes at %d offset.\n", bytes,
  894. +                count);
  895. + #endif
  896. + #if defined(SYSV) || (defined(__STDC__) && !defined(__HIGHC__))
  897. +            memcpy(data, stack + count, bytes);
  898. + #else
  899.              bcopy(stack + count, data, bytes);
  900. + #endif
  901.              newblocks = count / STACK_INC + ((count % STACK_INC) ? 1 : 0);
  902.              newsize = newblocks * STACK_INC;
  903.              if (newsize < size) {
  904. ***************
  905. *** 85,97 ****
  906. --- 122,143 ----
  907.               if (! stack) {
  908.                set_error(errno);
  909.                error("realloc");
  910. + #ifdef STACK_DEBUG
  911. +              fprintf(stderr, "dostack: return 7 (STACK_POP).\n");
  912. + #endif
  913.                return error_code;
  914.               }
  915.              }
  916. + #ifdef STACK_DEBUG
  917. +            fprintf(stderr, "dostack: return 8 (STACK_POP).\n");
  918. + #endif
  919.              return 0;
  920.         }
  921.        default:
  922.         set_error(STACK_BAD_OP);
  923. + #ifdef STACK_DEBUG
  924. +       fprintf(stderr, "dostack: return 9.\n");
  925. + #endif
  926.         return error_code;
  927.        }
  928.   }
  929.