home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 13 / CDA13.ISO / cdactual / demobin / share / program / C / ARC521_C.ZIP / PATCHES < prev    next >
Encoding:
Text File  |  1988-08-01  |  31.7 KB  |  1,364 lines

  1. diff -c /usr2/polymnia/hyc/News/arc/Make.tws arc/Make.tws
  2. *** /usr2/polymnia/hyc/News/arc/Make.tws    Wed Jul  6 02:26:14 1988
  3. --- arc/Make.tws    Sun Jul 31 18:29:28 1988
  4. ***************
  5. *** 22,33 ****
  6.   
  7.   libtws.a:    dtime.o dtimep.o lexstring.o
  8.           ar r libtws.a dtime.o dtimep.o lexstring.o
  9. ! # The following amusing bullshit makes sure that ranlib
  10. ! # gets executed if it is present, no matter which shell
  11. ! # make uses.  If there's a better way to do this, someone
  12. ! # please tell me!
  13. !         -if test -r /usr/bin/ranlib ; then ranlib libtws.a ; fi
  14. !         -if ( -r /usr/bin/ranlib ) ranlib libtws.a
  15.   
  16.   dtime.o:    dtime.c tws.h
  17.   
  18. --- 22,29 ----
  19.   
  20.   libtws.a:    dtime.o dtimep.o lexstring.o
  21.           ar r libtws.a dtime.o dtimep.o lexstring.o
  22. ! #Hope it goes, but no big deal if not. -- hyc
  23. !         -ranlib libtws.a
  24.   
  25.   dtime.o:    dtime.c tws.h
  26.   
  27. diff -c /usr2/polymnia/hyc/News/arc/arc.c arc/arc.c
  28. *** /usr2/polymnia/hyc/News/arc/arc.c    Wed Jul  6 02:26:55 1988
  29. --- arc/arc.c    Sun Jul 31 18:43:40 1988
  30. ***************
  31. *** 1,5 ****
  32.   /*
  33. !  * $Header: arc.c,v 1.10 88/06/17 15:22:48 hyc Locked $
  34.    */
  35.   
  36.   /*  ARC - Archive utility
  37. --- 1,5 ----
  38.   /*
  39. !  * $Header: arc.c,v 1.12 88/07/31 18:39:50 hyc Exp $
  40.    */
  41.   
  42.   /*  ARC - Archive utility
  43. ***************
  44. *** 73,88 ****
  45.   #include <stdio.h>
  46.   #include "arc.h"
  47.   
  48.   int        strlen();
  49.   void        addarc(), delarc(), extarc(), lstarc(), tstarc(), cvtarc(), runarc();
  50.   void        abort();
  51.   #if    MTS
  52.   void        etoa();
  53.   #endif
  54.   #if    GEMDOS
  55. ! long        _stksize = 24576;
  56.   #endif
  57.   char        *strcpy(), *strcat();
  58.   
  59.   static char   **lst;        /* files list */
  60.   static int    lnum;        /* length of files list */
  61. --- 73,95 ----
  62.   #include <stdio.h>
  63.   #include "arc.h"
  64.   
  65. + #if    UNIX
  66. + #include <sys/types.h>
  67. + #include <sys/stat.h>
  68. + #endif
  69.   int        strlen();
  70.   void        addarc(), delarc(), extarc(), lstarc(), tstarc(), cvtarc(), runarc();
  71.   void        abort();
  72. + static    void    expandlst();
  73.   #if    MTS
  74.   void        etoa();
  75.   #endif
  76.   #if    GEMDOS
  77. ! long        _stksize = 65536L;
  78.   #endif
  79.   char        *strcpy(), *strcat();
  80. + char        *makefnam();    /* filename fixup routine */
  81.   
  82.   static char   **lst;        /* files list */
  83.   static int    lnum;        /* length of files list */
  84. ***************
  85. *** 93,99 ****
  86.   {
  87.       char        opt = 0;/* selected action */
  88.       char           *a;    /* option pointer */
  89. -     char           *makefnam();    /* filename fixup routine */
  90.       void        upper();/* case conversion routine */
  91.       char           *index();/* string index utility */
  92.       char           *envfind();    /* environment searcher */
  93. --- 100,105 ----
  94. ***************
  95. *** 101,111 ****
  96. --- 107,121 ----
  97.       char           *arctemp2, *calloc(), *mktemp();
  98.   #if    GEMDOS
  99.       void        exitpause();
  100. +     int        append;
  101.   #endif
  102.   #if    MTS
  103.       fortran void    guinfo();
  104.       char        gotinf[4];
  105.   #endif
  106. + #if    UNIX
  107. +     struct    stat    sbuf;
  108. + #endif
  109.   
  110.       if (num < 3) {
  111.           printf("ARC - Archive utility, Version 5.21, created on 04/22/87 at 15:05:21\n");
  112. ***************
  113. *** 198,207 ****
  114.           if (arctemp[n - 1] != CUTOFF)
  115.               arctemp[n] = CUTOFF;
  116.       }
  117.   #if    !MSDOS
  118. !     strcat(arctemp, mktemp("AXXXXXX"));
  119.   #else
  120.       strcat(arctemp, "$ARCTEMP");
  121.   #endif
  122.   #else
  123.       guinfo("SHFSEP    ", gotinf);
  124. --- 208,224 ----
  125.           if (arctemp[n - 1] != CUTOFF)
  126.               arctemp[n] = CUTOFF;
  127.       }
  128. + #if    UNIX
  129. +     else    strcpy(arctemp, "/tmp/");
  130. + #endif
  131.   #if    !MSDOS
  132. !     {
  133. !         static char tempname[] = "AXXXXXX";
  134. !         strcat(arctemp, mktemp(tempname));
  135. !     }
  136.   #else
  137.       strcat(arctemp, "$ARCTEMP");
  138. +     arctemp2 = NULL;
  139.   #endif
  140.   #else
  141.       guinfo("SHFSEP    ", gotinf);
  142. ***************
  143. *** 223,229 ****
  144.   #endif
  145.   
  146.       /* create archive names, supplying defaults */
  147. !     makefnam(arg[2], ".arc", arcname);
  148.       /* makefnam(".$$$",arcname,newname); */
  149.       sprintf(newname, "%s.arc", arctemp);
  150.       makefnam(".BAK", arcname, bakname);
  151. --- 240,253 ----
  152.   #endif
  153.   
  154.       /* create archive names, supplying defaults */
  155. ! #if    UNIX
  156. !     if (!stat(arg[2],&sbuf))
  157. !         strcpy(arcname,arg[2]);
  158. !     else
  159. !         makefnam(arg[2],".arc",arcname);
  160. ! #else
  161. !     makefnam(arg[2], ".ARC", arcname);
  162. ! #endif
  163.       /* makefnam(".$$$",arcname,newname); */
  164.       sprintf(newname, "%s.arc", arctemp);
  165.       makefnam(".BAK", arcname, bakname);
  166. ***************
  167. *** 298,306 ****
  168. --- 322,346 ----
  169.       for (n = 0; n < lnum;) {/* expand indirect references */
  170.           if (*lst[n] == '@')
  171.               expandlst(n);
  172. + #if    GEMDOS        /* redirect stdout from the desktop...*/
  173. +         else if (*lst[n] == '>') {
  174. +             arctemp2 = (++lst[n]);
  175. +             lst[n] = lst[lnum-1];    /* delete this entry */
  176. +             lnum--;
  177. +             if (arctemp2[0] == '>') {
  178. +                 append = 1;
  179. +                 arctemp2++;
  180. +             }
  181. +             else    append = 0;
  182. +         }
  183. + #endif
  184.           else
  185.               n++;
  186.       }
  187. + #if    GEMDOS
  188. +     if (arctemp2)
  189. +         freopen(arctemp2,append ? "a" : "w",stdout);
  190. + #endif
  191.   
  192.       /* act on whatever action command was given */
  193.   
  194. ***************
  195. *** 349,355 ****
  196.   #endif
  197.       return nerrs;
  198.   }
  199. ! static
  200.   expandlst(n)            /* expand an indirect reference */
  201.       int        n;    /* number of entry to expand */
  202.   {
  203. --- 389,395 ----
  204.   #endif
  205.       return nerrs;
  206.   }
  207. ! static    void
  208.   expandlst(n)            /* expand an indirect reference */
  209.       int        n;    /* number of entry to expand */
  210.   {
  211. diff -c /usr2/polymnia/hyc/News/arc/arc.h arc/arc.h
  212. *** /usr2/polymnia/hyc/News/arc/arc.h    Wed Jul  6 02:26:56 1988
  213. --- arc/arc.h    Sun Jul 31 18:45:33 1988
  214. ***************
  215. *** 1,5 ****
  216.   /*
  217. !  * $Header: arc.h,v 1.7 88/06/01 17:51:06 hyc Locked $
  218.    */
  219.   
  220.   #undef    MSDOS
  221. --- 1,5 ----
  222.   /*
  223. !  * $Header: arc.h,v 1.9 88/07/31 18:43:18 hyc Exp $
  224.    */
  225.   
  226.   #undef    MSDOS
  227. ***************
  228. *** 27,32 ****
  229. --- 27,34 ----
  230.   #if    MSDOS || GEMDOS
  231.   #define    DOS    1
  232.   #define    CUTOFF    '\\'
  233. + #define    OPEN_R    "rb"
  234. + #define    OPEN_W    "wb"
  235.   #endif
  236.   
  237.   #if    !MSDOS
  238. ***************
  239. *** 37,53 ****
  240.   #if    BSD || SYSV
  241.   #define    UNIX    1
  242.   #define    CUTOFF    '/'
  243.   #include <ctype.h>
  244.   #endif
  245.   
  246.   #if    MTS
  247. ! #define rindex strrchr
  248. ! #define index strchr
  249. ! #undef  USEGFINFO        /* define this to use GFINFO for directory */
  250. ! #define USECATSCAN        /* scanning, else use CATSCAN/FILEINFO... */
  251.   #define    CUTOFF    sepchr[0]
  252.   #endif
  253.   
  254.   /*  ARC - Archive utility - ARC Header
  255.     
  256.       Version 2.17, created on 04/22/87 at 13:09:43
  257. --- 39,60 ----
  258.   #if    BSD || SYSV
  259.   #define    UNIX    1
  260.   #define    CUTOFF    '/'
  261. + #define    OPEN_R    "r"
  262. + #define    OPEN_W    "w"
  263.   #include <ctype.h>
  264.   #endif
  265.   
  266.   #if    MTS
  267. ! #define    USEGFINFO    0    /* define this to use GFINFO for directory */
  268. ! #define    USECATSCAN    1    /* scanning, else use CATSCAN/FILEINFO... */
  269.   #define    CUTOFF    sepchr[0]
  270.   #endif
  271.   
  272. + #if    MTS || SYSV
  273. + #define    rindex    strrchr
  274. + #define    index    strchr
  275. + #endif
  276.   /*  ARC - Archive utility - ARC Header
  277.     
  278.       Version 2.17, created on 04/22/87 at 13:09:43
  279. ***************
  280. *** 69,75 ****
  281.   #define ARCVER 9        /* archive header version code   */
  282.   #define STRLEN 100        /* system standard string length */
  283.   #define FNLEN 13        /* file name length              */
  284. ! #define MAXARG 25        /* maximum number of arguments   */
  285.   
  286.   #ifndef DONT_DEFINE        /* Defined by arcdata.c */
  287.   #include "arcs.h"
  288. --- 76,82 ----
  289.   #define ARCVER 9        /* archive header version code   */
  290.   #define STRLEN 100        /* system standard string length */
  291.   #define FNLEN 13        /* file name length              */
  292. ! #define MAXARG 400        /* maximum number of arguments   */
  293.   
  294.   #ifndef DONT_DEFINE        /* Defined by arcdata.c */
  295.   #include "arcs.h"
  296. diff -c /usr2/polymnia/hyc/News/arc/arcadd.c arc/arcadd.c
  297. *** /usr2/polymnia/hyc/News/arc/arcadd.c    Wed Jul  6 02:26:57 1988
  298. --- arc/arcadd.c    Sun Jul 31 18:47:27 1988
  299. ***************
  300. *** 1,5 ****
  301.   /*
  302. !  * $Header: arcadd.c,v 1.8 88/06/13 00:31:15 hyc Locked $
  303.    */
  304.   
  305.   /*
  306. --- 1,5 ----
  307.   /*
  308. !  * $Header: arcadd.c,v 1.9 88/07/31 18:45:14 hyc Exp $
  309.    */
  310.   
  311.   /*
  312. ***************
  313. *** 231,237 ****
  314.       int             upd = 0;/* true if replacing an entry */
  315.   
  316.   #if    !MTS
  317. !     if (!(f = fopen(path, "rb")))
  318.   #else
  319.       if (image)
  320.           f = fopen(path, "rb");
  321. --- 231,237 ----
  322.       int             upd = 0;/* true if replacing an entry */
  323.   
  324.   #if    !MTS
  325. !     if (!(f = fopen(path, OPEN_R)))
  326.   #else
  327.       if (image)
  328.           f = fopen(path, "rb");
  329. ***************
  330. *** 246,251 ****
  331. --- 246,280 ----
  332.           }
  333.           return;
  334.       }
  335. + #if    !DOS
  336. +     if (strlen(name) >= FNLEN) {
  337. +         if (warn) {
  338. +             char    buf[STRLEN];
  339. +             printf("WARNING: File %s name too long!\n", name);
  340. +             name[FNLEN-1]='\0';
  341. +             while(1) {
  342. +                 printf("  Truncate to %s (y/n)? ", name);
  343. +                 fflush(stdout);
  344. +                 fgets(buf, STRLEN, stdin);
  345. +                 *buf = toupper(*buf);
  346. +                 if (*buf == 'Y' || *buf == 'N')
  347. +                     break;
  348. +             }
  349. +             if (*buf == 'N') {
  350. +                 printf("Skipping...\n");
  351. +                 fclose(f);
  352. +                 return;
  353. +             }
  354. +         }
  355. +         else {
  356. +             if (note)
  357. +                 printf("Skipping file: %s - name too long.\n",
  358. +                     name);
  359. +             fclose(f);
  360. +             return;
  361. +         }
  362. +     }
  363. + #endif
  364.       strcpy(nhdr.name, name);/* save name */
  365.       nhdr.size = 0;        /* clear out size storage */
  366.       nhdr.crc = 0;        /* clear out CRC check storage */
  367. ***************
  368. *** 257,269 ****
  369.       int    inlen;
  370.       struct    GDDSECT    *region;
  371.   
  372. !     region=gdinfo(f->_fd);
  373.       inlen=region->GDINLEN;
  374. !     buffer=malloc(inlen);   /* maximum line length */
  375.       setbuf(f,buffer);        
  376.       f->_bufsiz=inlen;        
  377. !     f->_mods|=0x00040000;   /* Don't do "$continue with" */
  378. !     f->_mods&=0xfff7ffff;   /* turn it off, if set... */
  379.       }
  380.       getstamp(path, &nhdr.date, &nhdr.time);
  381.   #endif
  382. --- 286,298 ----
  383.       int    inlen;
  384.       struct    GDDSECT    *region;
  385.   
  386. !     region=gdinfo(f->_fd._fdub);
  387.       inlen=region->GDINLEN;
  388. !     buffer=malloc(inlen);    /* maximum line length */
  389.       setbuf(f,buffer);        
  390.       f->_bufsiz=inlen;        
  391. !     f->_mods|=_NOIC;    /* Don't do "$continue with" */
  392. !     f->_mods&=~_IC;        /* turn it off, if set... */
  393.       }
  394.       getstamp(path, &nhdr.date, &nhdr.time);
  395.   #endif
  396. ***************
  397. *** 325,331 ****
  398.       hdrver = ARCVER;        /* anything but end marker */
  399.       writehdr(&nhdr, new);    /* write out header skeleton */
  400.       pack(f, new, &nhdr);    /* pack file into archive */
  401. -     strcpy(nhdr.name, name);
  402.       fseek(new, starts, 0);    /* move back to header skeleton */
  403.       writehdr(&nhdr, new);    /* write out real header */
  404.       fseek(new, nhdr.size, 1);    /* skip over data to next header */
  405. --- 354,359 ----
  406. diff -c /usr2/polymnia/hyc/News/arc/arcdata.c arc/arcdata.c
  407. *** /usr2/polymnia/hyc/News/arc/arcdata.c    Wed Jul  6 02:26:59 1988
  408. --- arc/arcdata.c    Sun Jul 31 18:48:38 1988
  409. ***************
  410. *** 1,5 ****
  411.   /*
  412. !  * $Header: arcdata.c,v 1.6 88/06/01 19:17:58 hyc Locked $
  413.    */
  414.   
  415.   /*  ARC - Archive utility - ARCDATA
  416. --- 1,5 ----
  417.   /*
  418. !  * $Header: arcdata.c,v 1.7 88/07/31 18:47:22 hyc Exp $
  419.    */
  420.   
  421.   /*  ARC - Archive utility - ARCDATA
  422. diff -c /usr2/polymnia/hyc/News/arc/arcdos.c arc/arcdos.c
  423. *** /usr2/polymnia/hyc/News/arc/arcdos.c    Wed Jul  6 02:27:00 1988
  424. --- arc/arcdos.c    Sun Jul 31 18:49:42 1988
  425. ***************
  426. *** 1,5 ****
  427.   /*
  428. !  * $Header: arcdos.c,v 1.5 88/06/13 00:40:49 hyc Locked $
  429.    */
  430.   
  431.   /*
  432. --- 1,5 ----
  433.   /*
  434. !  * $Header: arcdos.c,v 1.6 88/07/31 18:48:09 hyc Exp $
  435.    */
  436.   
  437.   /*
  438. ***************
  439. *** 35,40 ****
  440. --- 35,41 ----
  441.   #endif
  442.   
  443.   #if    SYSV
  444. + #include <sys/times.h>
  445.   struct timeval {
  446.       long tv_sec;
  447.       long tv_usec;
  448. ***************
  449. *** 78,100 ****
  450.       *time = ret[0];
  451.   #endif
  452.   #if    UNIX
  453. !     char           *ctime();
  454. !     struct stat    *buf;
  455. !     int             day, hr, min, sec, yr, imon;
  456. !     static char     mon[4], *mons[12] = {
  457. !                    "Jan", "Feb", "Mar", "Apr", "May", "Jun",
  458. !                     "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
  459. !     };
  460.   
  461. !     buf = (struct stat *) malloc(sizeof(struct stat));
  462. !     fstat(fileno(f), buf);
  463. !     sscanf(ctime(&(buf->st_mtime)), "%*4s%3s%d%d:%d:%d%d", mon, &day, &hr, &min,
  464. !            &sec, &yr);
  465. !     for (imon = 0; imon < 12 && strcmp(mon, mons[imon]); imon++);
  466. !     *date = (unsigned short) (((yr - 1980) << 9) + ((imon + 1) << 5) + day);
  467. !     *time = (unsigned short) ((hr << 11) + (min << 5) + sec / 2);
  468.   #endif
  469.   #if    MTS
  470.       fortran         timein(),
  471. --- 79,93 ----
  472.       *time = ret[0];
  473.   #endif
  474.   #if    UNIX
  475. !     struct stat    buf;
  476. !     struct tm    *localtime(), *t;
  477.   
  478. !     fstat(fileno(f), &buf);
  479. !     t=localtime(&(buf.st_mtime));
  480. !     *date = (unsigned short) (((t->tm_year - 80) << 9) +
  481. !                 ((t->tm_mon + 1) << 5) + t->tm_mday);
  482. !     *time = (unsigned short) ((t->tm_hour << 11) +
  483. !                 (t->tm_min << 5) + t->tm_sec / 2);
  484.   #endif
  485.   #if    MTS
  486.       fortran         timein(),
  487. diff -c /usr2/polymnia/hyc/News/arc/arcext.c arc/arcext.c
  488. *** /usr2/polymnia/hyc/News/arc/arcext.c    Wed Jul  6 02:27:01 1988
  489. --- arc/arcext.c    Fri Jul 22 14:53:29 1988
  490. ***************
  491. *** 155,161 ****
  492.           }
  493.       }
  494.   #if    !MTS
  495. !     if (!(f = fopen(fix, "wb")))
  496.   #else
  497.       {
  498.           fortran         create();
  499. --- 155,161 ----
  500.           }
  501.       }
  502.   #if    !MTS
  503. !     if (!(f = fopen(fix, OPEN_W)))
  504.   #else
  505.       {
  506.           fortran         create();
  507. diff -c /usr2/polymnia/hyc/News/arc/arcio.c arc/arcio.c
  508. *** /usr2/polymnia/hyc/News/arc/arcio.c    Wed Jul  6 02:27:02 1988
  509. --- arc/arcio.c    Sun Jul 31 18:50:20 1988
  510. ***************
  511. *** 1,5 ****
  512.   /*
  513. !  * $Header: arcio.c,v 1.7 88/06/02 16:27:32 hyc Locked $
  514.    */
  515.   
  516.   /*  ARC - Archive utility - ARCIO
  517. --- 1,5 ----
  518.   /*
  519. !  * $Header: arcio.c,v 1.9 88/07/31 18:49:19 hyc Exp $
  520.    */
  521.   
  522.   /*  ARC - Archive utility - ARCIO
  523. ***************
  524. *** 102,112 ****
  525.   #if    MTS
  526.       (void) atoe(hdr->name, strlen(hdr->name));
  527.   #endif
  528. !     for (i = 0; i<4; hdr->size<<=8, hdr->size += dummy[16-i], i++);
  529.       hdr->date = (short) ((dummy[18] << 8) + dummy[17]);
  530.       hdr->time = (short) ((dummy[20] << 8) + dummy[19]);
  531.       hdr->crc = (short) ((dummy[22] << 8) + dummy[21]);
  532. !     for (i = 0; i<4; hdr->length<<=8, hdr->length += dummy[26-i], i++);
  533.   #endif
  534.   
  535.       if (hdr->date > olddate
  536. --- 102,112 ----
  537.   #if    MTS
  538.       (void) atoe(hdr->name, strlen(hdr->name));
  539.   #endif
  540. !     for (i = 0, hdr->size=0; i<4; hdr->size<<=8, hdr->size += dummy[16-i], i++);
  541.       hdr->date = (short) ((dummy[18] << 8) + dummy[17]);
  542.       hdr->time = (short) ((dummy[20] << 8) + dummy[19]);
  543.       hdr->crc = (short) ((dummy[22] << 8) + dummy[21]);
  544. !     for (i = 0, hdr->length=0; i<4; hdr->length<<=8, hdr->length += dummy[26-i], i++);
  545.   #endif
  546.   
  547.       if (hdr->date > olddate
  548. ***************
  549. *** 175,187 ****
  550.       FILE           *t;    /* file to write to */
  551.   {
  552.       c &= 0xff;
  553. !     if (t)
  554.   #if    UNIX
  555.           fputc(c, t);
  556.   #else
  557.           if (fputc(c, t) == EOF)
  558.               abort("Write fail (disk full?)");
  559.   #endif
  560.   }
  561.   
  562.   /*
  563. --- 175,190 ----
  564.       FILE           *t;    /* file to write to */
  565.   {
  566.       c &= 0xff;
  567. !     if (t) {
  568.   #if    UNIX
  569.           fputc(c, t);
  570. +         if (ferror(t))
  571. +             abort("Write failed");
  572.   #else
  573.           if (fputc(c, t) == EOF)
  574.               abort("Write fail (disk full?)");
  575.   #endif
  576. +     }
  577.   }
  578.   
  579.   /*
  580. diff -c /usr2/polymnia/hyc/News/arc/arclzw.c arc/arclzw.c
  581. *** /usr2/polymnia/hyc/News/arc/arclzw.c    Wed Jul  6 02:27:19 1988
  582. --- arc/arclzw.c    Sun Jul 31 18:50:49 1988
  583. ***************
  584. *** 1,5 ****
  585.   /*
  586. !  * $Header: arclzw.c,v 1.4 88/06/01 16:27:59 hyc Locked $
  587.    */
  588.   
  589.   /*
  590. --- 1,5 ----
  591.   /*
  592. !  * $Header: arclzw.c,v 1.6 88/07/31 18:49:49 hyc Exp $
  593.    */
  594.   
  595.   /*
  596. ***************
  597. *** 59,65 ****
  598.       unsigned char   follower;    /* char following string */
  599.       unsigned short  next;    /* ptr to next in collision list */
  600.       unsigned short  predecessor;    /* code for preceeding string */
  601. ! };            /* string_tab[TABSIZE];    /* the code string table */
  602.   
  603.   
  604.   /* definitions for the new dynamic Lempel-Zev crunching */
  605. --- 59,65 ----
  606.       unsigned char   follower;    /* char following string */
  607.       unsigned short  next;    /* ptr to next in collision list */
  608.       unsigned short  predecessor;    /* code for preceeding string */
  609. ! };            /* string_tab[TABSIZE];       the code string table */
  610.   
  611.   
  612.   /* definitions for the new dynamic Lempel-Zev crunching */
  613. diff -c /usr2/polymnia/hyc/News/arc/arcmatch.c arc/arcmatch.c
  614. *** /usr2/polymnia/hyc/News/arc/arcmatch.c    Wed Jul  6 02:27:20 1988
  615. --- arc/arcmatch.c    Sun Jul 31 18:51:22 1988
  616. ***************
  617. *** 1,5 ****
  618.   /*
  619. !  * $Header: arcmatch.c,v 1.5 88/06/01 19:41:08 hyc Locked $
  620.    */
  621.   
  622.   /*
  623. --- 1,5 ----
  624.   /*
  625. !  * $Header: arcmatch.c,v 1.6 88/07/31 18:50:18 hyc Exp $
  626.    */
  627.   
  628.   /*
  629. ***************
  630. *** 67,72 ****
  631. --- 67,77 ----
  632.       upper(t);        /* avoid case problems */
  633.   #endif    /* UNIX */
  634.   #if    GEMDOS
  635. +     char *strstr(), *i;    /* allow "*.*" to mean '*' */
  636. +     if (i=strstr(t,"*.*")) {
  637. +         i++;
  638. +         *i='\0';
  639. +     }
  640.       return(pnmatch(n, t, 0));
  641.   #else
  642.       /* first match name part */
  643. diff -c /usr2/polymnia/hyc/News/arc/arcmisc.c arc/arcmisc.c
  644. *** /usr2/polymnia/hyc/News/arc/arcmisc.c    Wed Jul  6 02:27:21 1988
  645. --- arc/arcmisc.c    Sun Jul 31 18:52:44 1988
  646. ***************
  647. *** 1,6 ****
  648.   /*
  649.    * Miscellaneous routines to get ARC running on non-MSDOS systems...
  650. !  * $Header: arcmisc.c,v 1.7 88/06/12 19:23:13 hyc Locked $ 
  651.    */
  652.   
  653.   #include <stdio.h>
  654. --- 1,6 ----
  655.   /*
  656.    * Miscellaneous routines to get ARC running on non-MSDOS systems...
  657. !  * $Header: arcmisc.c,v 1.8 88/07/31 18:50:56 hyc Exp $ 
  658.    */
  659.   
  660.   #include <stdio.h>
  661. ***************
  662. *** 55,61 ****
  663.   #include <sys/types.h>
  664.   #include <sys/dir.h>
  665.   #include <sys/stat.h>
  666. !     int    rename();
  667.   #endif
  668.   
  669.   #if    SYSV
  670. --- 55,61 ----
  671.   #include <sys/types.h>
  672.   #include <sys/dir.h>
  673.   #include <sys/stat.h>
  674. !     int    rename(), unlink();
  675.   #endif
  676.   
  677.   #if    SYSV
  678. ***************
  679. *** 65,72 ****
  680.   #define DIRECT direct
  681.   #endif
  682.   
  683.   char           *strcpy(), *strcat(), *malloc();
  684. ! int             strlen();
  685.   
  686.   int
  687.   move(oldnam, newnam)
  688. --- 65,85 ----
  689.   #define DIRECT direct
  690.   #endif
  691.   
  692. + #if    BSD
  693. + char    *
  694. + memset(s, c, n)        /* oops. Thought it was standard BSD, but my Sun */
  695. +     char    *s;    /* fooled me again. -- hyc */
  696. +     int    c, n;
  697. + {
  698. +     register int i;
  699. +     for(i=0;i<n;i++)
  700. +         s[i]=c;
  701. +     return(s);
  702. + }
  703. + #endif
  704.   char           *strcpy(), *strcat(), *malloc();
  705. ! int             strlen(), strcmp(), match();
  706.   
  707.   int
  708.   move(oldnam, newnam)
  709. ***************
  710. *** 73,79 ****
  711. --- 86,94 ----
  712.       char           *oldnam, *newnam;
  713.   {
  714.       FILE           *fopen(), *old, *new;
  715. + #if    !MTS
  716.       struct stat     oldstat;
  717. + #endif
  718.       char           *strcpy();
  719.       void        filecopy();
  720.   #if    GEMDOS
  721. ***************
  722. *** 81,99 ****
  723.   #else
  724.       if (rename(oldnam, newnam))
  725.   #endif
  726.       {
  727.           if (stat(oldnam, &oldstat))    /* different partition? */
  728.               return (-1);
  729. !         old = fopen(oldnam, "rb");
  730.           if (old == NULL)
  731.               return (-1);
  732. !         new = fopen(newnam, "wb");
  733.           if (new == NULL)
  734.               return (-1);
  735.           filecopy(old, new, oldstat.st_size);
  736. !         unlink(oldnam);
  737.       }
  738.       return 0;
  739.   }
  740.   
  741.   static void
  742. --- 96,118 ----
  743.   #else
  744.       if (rename(oldnam, newnam))
  745.   #endif
  746. + #if    !MTS
  747.       {
  748.           if (stat(oldnam, &oldstat))    /* different partition? */
  749.               return (-1);
  750. !         old = fopen(oldnam, OPEN_R);
  751.           if (old == NULL)
  752.               return (-1);
  753. !         new = fopen(newnam, OPEN_W);
  754.           if (new == NULL)
  755.               return (-1);
  756.           filecopy(old, new, oldstat.st_size);
  757. !         return(unlink(oldnam));
  758.       }
  759.       return 0;
  760. + #else
  761. +     return(-1);
  762. + #endif
  763.   }
  764.   
  765.   static void
  766. ***************
  767. *** 270,276 ****
  768.       int             alphasort();
  769.       int             scandir();
  770.   #endif                /* UNIX */
  771. !     int             fmatch();
  772.       static int      Nnum = 0, ii;
  773.       char        *rindex();
  774.   
  775. --- 289,295 ----
  776.       int             alphasort();
  777.       int             scandir();
  778.   #endif                /* UNIX */
  779. !     int             fmatch(), free();
  780.       static int      Nnum = 0, ii;
  781.       char        *rindex();
  782.   
  783. diff -c /usr2/polymnia/hyc/News/arc/arcpack.c arc/arcpack.c
  784. *** /usr2/polymnia/hyc/News/arc/arcpack.c    Wed Jul  6 02:27:22 1988
  785. --- arc/arcpack.c    Sun Jul 31 18:53:25 1988
  786. ***************
  787. *** 1,5 ****
  788.   /*
  789. !  * $Header: arcpack.c,v 1.9 88/06/02 16:27:36 hyc Locked $
  790.    */
  791.   
  792.   /*  ARC - Archive utility - ARCPACK
  793. --- 1,5 ----
  794.   /*
  795. !  * $Header: arcpack.c,v 1.11 88/07/31 18:52:08 hyc Exp $
  796.    */
  797.   
  798.   /*  ARC - Archive utility - ARCPACK
  799. ***************
  800. *** 24,30 ****
  801.   #endif
  802.   
  803.   void    setcode(), sqinit_cm(), sqputc_cm(), init_cm(), putc_cm();
  804. ! void    filecopy(), abort(), putc_tst();
  805.   int    getch(), addcrc();
  806.   
  807.   /* stuff for non-repeat packing */
  808. --- 24,30 ----
  809.   #endif
  810.   
  811.   void    setcode(), sqinit_cm(), sqputc_cm(), init_cm(), putc_cm();
  812. ! void    filecopy(), abort(), putc_tst(), init_sq(), scan_sq();
  813.   int    getch(), addcrc();
  814.   
  815.   /* stuff for non-repeat packing */
  816. ***************
  817. *** 155,161 ****
  818.       /* standard cleanups common to all methods */
  819.   
  820.       if (note)
  821. !         printf("done. (%ld%%)\n",100L - (100L*hdr->size)/hdr->length);
  822.   }
  823.   
  824.   /*
  825. --- 155,162 ----
  826.       /* standard cleanups common to all methods */
  827.   
  828.       if (note)
  829. !         printf("done. (%ld%%)\n",hdr->length == 0 ?
  830. !                 0L : 100L - (100L*hdr->size)/hdr->length);
  831.   }
  832.   
  833.   /*
  834. diff -c /usr2/polymnia/hyc/News/arc/arcrun.c arc/arcrun.c
  835. *** /usr2/polymnia/hyc/News/arc/arcrun.c    Wed Jul  6 02:27:22 1988
  836. --- arc/arcrun.c    Sun Jul 31 18:53:59 1988
  837. ***************
  838. *** 1,5 ****
  839.   /*
  840. !  * $Header: arcrun.c,v 1.3 88/06/01 19:57:16 hyc Locked $
  841.    */
  842.   
  843.   /*
  844. --- 1,5 ----
  845.   /*
  846. !  * $Header: arcrun.c,v 1.4 88/07/31 18:52:50 hyc Exp $
  847.    */
  848.   
  849.   /*
  850. ***************
  851. *** 22,27 ****
  852. --- 22,29 ----
  853.   #include "arc.h"
  854.   
  855.   void    rempath(), openarc(), closearc(), abort();
  856. + int    readhdr(), match(), unpack();
  857. + static    void    runfile();
  858.   char    *strcat();
  859.   
  860.   void
  861. ***************
  862. *** 33,39 ****
  863.       char           *makefnam();    /* filename fixer */
  864.       char            buf[STRLEN];    /* filename buffer */
  865.       FILE           *fopen();/* file opener */
  866. -     int             runfile();
  867.       char           *dummy[2];
  868.   
  869.       dummy[0]="dummy";
  870. --- 35,40 ----
  871. ***************
  872. *** 56,62 ****
  873.       closearc(0);        /* close archive after changes */
  874.   }
  875.   
  876. ! static          int
  877.   runfile(hdr, num, arg)        /* run a file */
  878.       struct heads   *hdr;    /* pointer to header data */
  879.       int             num;    /* number of arguments */
  880. --- 57,63 ----
  881.       closearc(0);        /* close archive after changes */
  882.   }
  883.   
  884. ! static  void
  885.   runfile(hdr, num, arg)        /* run a file */
  886.       struct heads   *hdr;    /* pointer to header data */
  887.       int             num;    /* number of arguments */
  888. ***************
  889. *** 120,126 ****
  890.       if (warn)
  891.           if (tmp = fopen(buf, "r"))
  892.               abort("Temporary file %s already exists", buf);
  893. !     if (!(tmp = fopen(buf, "wb")))
  894.           abort("Unable to create temporary file %s", buf);
  895.   
  896.       if (note)
  897. --- 121,127 ----
  898.       if (warn)
  899.           if (tmp = fopen(buf, "r"))
  900.               abort("Temporary file %s already exists", buf);
  901. !     if (!(tmp = fopen(buf, OPEN_W)))
  902.           abort("Unable to create temporary file %s", buf);
  903.   
  904.       if (note)
  905. diff -c /usr2/polymnia/hyc/News/arc/arcsq.c arc/arcsq.c
  906. *** /usr2/polymnia/hyc/News/arc/arcsq.c    Wed Jul  6 02:27:24 1988
  907. --- arc/arcsq.c    Sun Jul 31 18:54:48 1988
  908. ***************
  909. *** 1,5 ****
  910.   /*
  911. !  * $Header: arcsq.c,v 1.2 88/06/02 16:27:38 hyc Locked $
  912.    */
  913.   
  914.   /*
  915. --- 1,5 ----
  916.   /*
  917. !  * $Header: arcsq.c,v 1.3 88/07/31 18:53:32 hyc Exp $
  918.    */
  919.   
  920.   /*
  921. ***************
  922. *** 65,71 ****
  923.   static int      cbitsrem;    /* # of code string bits left */
  924.   static unsigned short ccode;    /* current code right justified */
  925.   
  926. ! int 
  927.   init_sq()
  928.   {                /* prepare for scanning pass */
  929.       int             i;    /* node index */
  930. --- 65,73 ----
  931.   static int      cbitsrem;    /* # of code string bits left */
  932.   static unsigned short ccode;    /* current code right justified */
  933.   
  934. ! static    void    scale(), heap(), adjust(), bld_tree(), init_enc(), put_int();
  935. ! static    int    cmptrees(), buildenc(), maxchar();
  936. ! void 
  937.   init_sq()
  938.   {                /* prepare for scanning pass */
  939.       int             i;    /* node index */
  940. ***************
  941. *** 86,92 ****
  942.           valcount[i] = 0;
  943.   }
  944.   
  945. ! int 
  946.   scan_sq(c)            /* add a byte to the tables */
  947.       int             c;    /* byte to add */
  948.   {
  949. --- 88,94 ----
  950.           valcount[i] = 0;
  951.   }
  952.   
  953. ! void 
  954.   scan_sq(c)            /* add a byte to the tables */
  955.       int             c;    /* byte to add */
  956.   {
  957. ***************
  958. *** 113,123 ****
  959.       unsigned short    ceiling;/* limit for scaling */
  960.       long            size = 0;    /* predicted size */
  961.       int             numnodes;    /* # of nodes in simplified tree */
  962. -     int             scale();
  963. -     int             heap();
  964. -     int             bld_tree();
  965. -     int             buildenc();
  966. -     int             init_enc();
  967.   
  968.       scan_sq(EOF);        /* signal end of input */
  969.   
  970. --- 115,120 ----
  971. ***************
  972. *** 188,194 ****
  973.    * integer. Rescaling is used if necessary to limit the code length. 
  974.    */
  975.   
  976. ! static int 
  977.   scale(ceil)
  978.       unsigned short    ceil;    /* upper limit on total weight */
  979.   {
  980. --- 185,191 ----
  981.    * integer. Rescaling is used if necessary to limit the code length. 
  982.    */
  983.   
  984. ! static    void
  985.   scale(ceil)
  986.       unsigned short    ceil;    /* upper limit on total weight */
  987.   {
  988. ***************
  989. *** 236,247 ****
  990.    * rescaling. 
  991.    */
  992.   
  993. ! static int 
  994.   heap(list, length)
  995.       int             list[], length;
  996.   {
  997.       register int    i;
  998. -     int             adjust();
  999.   
  1000.       for (i = (length - 2) / 2; i >= 0; --i)
  1001.           adjust(list, i, length - 1);
  1002. --- 233,243 ----
  1003.    * rescaling. 
  1004.    */
  1005.   
  1006. ! static    void
  1007.   heap(list, length)
  1008.       int             list[], length;
  1009.   {
  1010.       register int    i;
  1011.   
  1012.       for (i = (length - 2) / 2; i >= 0; --i)
  1013.           adjust(list, i, length - 1);
  1014. ***************
  1015. *** 249,260 ****
  1016.   
  1017.   /* Make a heap from a heap with a new top */
  1018.   
  1019. ! static int 
  1020.   adjust(list, top, bottom)
  1021.       int             list[], top, bottom;
  1022.   {
  1023.       register int    k, temp;
  1024. -     int             cmptrees();
  1025.   
  1026.       k = 2 * top + 1;    /* left child of top */
  1027.       temp = list[top];    /* remember root node of top tree */
  1028. --- 245,255 ----
  1029.   
  1030.   /* Make a heap from a heap with a new top */
  1031.   
  1032. ! static    void
  1033.   adjust(list, top, bottom)
  1034.       int             list[], top, bottom;
  1035.   {
  1036.       register int    k, temp;
  1037.   
  1038.       k = 2 * top + 1;    /* left child of top */
  1039.       temp = list[top];    /* remember root node of top tree */
  1040. ***************
  1041. *** 282,288 ****
  1042.    * comparison rules in previous comments. 
  1043.    */
  1044.   
  1045. ! static int 
  1046.   cmptrees(a, b)
  1047.       int             a, b;    /* root nodes of trees */
  1048.   {
  1049. --- 277,283 ----
  1050.    * comparison rules in previous comments. 
  1051.    */
  1052.   
  1053. ! static    int 
  1054.   cmptrees(a, b)
  1055.       int             a, b;    /* root nodes of trees */
  1056.   {
  1057. ***************
  1058. *** 308,314 ****
  1059.    * element and reheaping the shorter list. 
  1060.    */
  1061.   
  1062. ! static int 
  1063.   bld_tree(list, len)
  1064.       int             list[];
  1065.   int             len;
  1066. --- 303,309 ----
  1067.    * element and reheaping the shorter list. 
  1068.    */
  1069.   
  1070. ! static    void
  1071.   bld_tree(list, len)
  1072.       int             list[];
  1073.   int             len;
  1074. ***************
  1075. *** 316,322 ****
  1076.       register int    freenode;    /* next free node in tree */
  1077.       register struct nd *frnp;    /* free node pointer */
  1078.       int             lch, rch;    /* temps for left, right children */
  1079. -     int             maxchar();
  1080.   
  1081.       /*
  1082.        * Initialize index to next available (non-leaf) node. Lower numbered
  1083. --- 311,316 ----
  1084. ***************
  1085. *** 365,371 ****
  1086.       return a > b ? a : b;
  1087.   }
  1088.   
  1089. ! static int 
  1090.   init_enc()
  1091.   {
  1092.       register int    i;
  1093. --- 359,365 ----
  1094.       return a > b ? a : b;
  1095.   }
  1096.   
  1097. ! static    void
  1098.   init_enc()
  1099.   {
  1100.       register int    i;
  1101. ***************
  1102. *** 421,431 ****
  1103.       return NULL;        /* it worked if we reach here */
  1104.   }
  1105.   
  1106. ! static int 
  1107.   put_int(n, f)            /* output an integer */
  1108.       short        n;    /* integer to output */
  1109.       FILE           *f;    /* file to put it to */
  1110.   {
  1111.       putc_pak(n & 0xff, f);    /* first the low byte */
  1112.       putc_pak(n >> 8, f);    /* then the high byte */
  1113.   }
  1114. --- 415,427 ----
  1115.       return NULL;        /* it worked if we reach here */
  1116.   }
  1117.   
  1118. ! static    void
  1119.   put_int(n, f)            /* output an integer */
  1120.       short        n;    /* integer to output */
  1121.       FILE           *f;    /* file to put it to */
  1122.   {
  1123. +     void        putc_pak();
  1124.       putc_pak(n & 0xff, f);    /* first the low byte */
  1125.       putc_pak(n >> 8, f);    /* then the high byte */
  1126.   }
  1127. ***************
  1128. *** 481,486 ****
  1129. --- 477,483 ----
  1130.   {
  1131.       int             rbyte;    /* Result byte value */
  1132.       int             need;    /* number of bits */
  1133. +     int        getc_ncr();
  1134.   
  1135.       rbyte = 0;
  1136.       need = 8;        /* build one byte per call */
  1137. diff -c /usr2/polymnia/hyc/News/arc/arcsqs.c arc/arcsqs.c
  1138. *** /usr2/polymnia/hyc/News/arc/arcsqs.c    Wed Jul  6 02:27:43 1988
  1139. --- arc/arcsqs.c    Sun Jul 31 18:55:21 1988
  1140. ***************
  1141. *** 1,5 ****
  1142.   /*
  1143. !  * $Header: arcsqs.c,v 1.2 88/06/01 16:31:39 hyc Locked $
  1144.    */
  1145.   
  1146.   /*  ARC - Archive utility - SQUASH
  1147. --- 1,5 ----
  1148.   /*
  1149. !  * $Header: arcsqs.c,v 1.3 88/07/31 18:54:14 hyc Exp $
  1150.    */
  1151.   
  1152.   /*  ARC - Archive utility - SQUASH
  1153. ***************
  1154. *** 12,18 ****
  1155.   */
  1156.   
  1157.   /*
  1158. !  * $Header: arcsqs.c,v 1.2 88/06/01 16:31:39 hyc Locked $
  1159.    */
  1160.   
  1161.   #include <stdio.h>
  1162. --- 12,18 ----
  1163.   */
  1164.   
  1165.   /*
  1166. !  * $Header: arcsqs.c,v 1.3 88/07/31 18:54:14 hyc Exp $
  1167.    */
  1168.   
  1169.   #include <stdio.h>
  1170. diff -c /usr2/polymnia/hyc/News/arc/arcsvc.c arc/arcsvc.c
  1171. *** /usr2/polymnia/hyc/News/arc/arcsvc.c    Wed Jul  6 02:27:44 1988
  1172. --- arc/arcsvc.c    Sun Jul 31 18:55:55 1988
  1173. ***************
  1174. *** 1,5 ****
  1175.   /*
  1176. !  * $Header: arcsvc.c,v 1.8 88/06/13 00:42:59 hyc Locked $
  1177.    */
  1178.   
  1179.   /*  ARC - Archive utility - ARCSVC
  1180. --- 1,5 ----
  1181.   /*
  1182. !  * $Header: arcsvc.c,v 1.9 88/07/31 18:54:55 hyc Exp $
  1183.    */
  1184.   
  1185.   /*  ARC - Archive utility - ARCSVC
  1186. ***************
  1187. *** 31,37 ****
  1188.   {
  1189.       FILE           *fopen();/* file opener */
  1190.   
  1191. !     if (!(arc = fopen(arcname, "rb"))) {
  1192.           if (chg) {
  1193.               if (note)
  1194.                   printf("Creating new archive: %s\n", arcname);
  1195. --- 31,37 ----
  1196.   {
  1197.       FILE           *fopen();/* file opener */
  1198.   
  1199. !     if (!(arc = fopen(arcname, OPEN_R))) {
  1200.           if (chg) {
  1201.               if (note)
  1202.                   printf("Creating new archive: %s\n", arcname);
  1203. ***************
  1204. *** 45,51 ****
  1205.           int inlen;
  1206.           struct GDDSECT *region;
  1207.   
  1208. !         region=gdinfo(arc->_fd);
  1209.           inlen=region->GDINLEN;
  1210.           buffer=malloc(inlen);
  1211.           setbuf(arc, buffer);
  1212. --- 45,51 ----
  1213.           int inlen;
  1214.           struct GDDSECT *region;
  1215.   
  1216. !         region=gdinfo(arc->_fd._fdub);
  1217.           inlen=region->GDINLEN;
  1218.           buffer=malloc(inlen);
  1219.           setbuf(arc, buffer);
  1220. ***************
  1221. *** 53,59 ****
  1222.       }
  1223.   #endif
  1224.       if (chg) {        /* if opening for changes */
  1225. !         if (!(new = fopen(newname, "wb")))
  1226.               abort("Cannot create archive copy: %s", newname);
  1227.   
  1228.       changing = chg;        /* note if open for changes */
  1229. --- 53,59 ----
  1230.       }
  1231.   #endif
  1232.       if (chg) {        /* if opening for changes */
  1233. !         if (!(new = fopen(newname, OPEN_W)))
  1234.               abort("Cannot create archive copy: %s", newname);
  1235.   
  1236.       changing = chg;        /* note if open for changes */
  1237. ***************
  1238. *** 66,73 ****
  1239.   {
  1240.       if (arc) {        /* if we had an initial archive */
  1241.           fclose(arc);
  1242. -         if (kludge)    /* kludge to update timestamp */
  1243.   #if    !MTS
  1244.               setstamp(arcname, olddate, oldtime);
  1245.   #endif
  1246.       }
  1247. --- 66,73 ----
  1248.   {
  1249.       if (arc) {        /* if we had an initial archive */
  1250.           fclose(arc);
  1251.   #if    !MTS
  1252. +         if (kludge)    /* kludge to update timestamp */
  1253.               setstamp(arcname, olddate, oldtime);
  1254.   #endif
  1255.       }
  1256. diff -c /usr2/polymnia/hyc/News/arc/marc.c arc/marc.c
  1257. *** /usr2/polymnia/hyc/News/arc/marc.c    Wed Jul  6 02:27:53 1988
  1258. --- arc/marc.c    Fri Jul 22 14:59:11 1988
  1259. ***************
  1260. *** 25,30 ****
  1261. --- 25,35 ----
  1262.   #include <stdio.h>
  1263.   #include "arc.h"
  1264.   
  1265. + #if    UNIX
  1266. + #include <sys/types.h>
  1267. + #include <sys/stat.h>
  1268. + #endif
  1269.   FILE *src;                   /* source archive */
  1270.   char srcname[STRLEN];               /* source archive name */
  1271.   
  1272. ***************
  1273. *** 46,52 ****
  1274. --- 51,61 ----
  1275.       void exitpause();
  1276.   #endif
  1277.       int n;                   /* index */
  1278. + #if    UNIX
  1279. +     struct    stat    sbuf;
  1280. + #endif
  1281.   
  1282.       if(nargs<3)
  1283.       {     printf("MARC - Archive merger, Version 5.21, created on 04/22/87 at 15:05:10\n");
  1284.   /*     printf("(C) COPYRIGHT 1985,86,87 by System Enhancement Associates;");
  1285. ***************
  1286. *** 96,102 ****
  1287.               arctemp[n] = CUTOFF;
  1288.       }
  1289.   #if    !MSDOS
  1290. !     strcat(arctemp, mktemp("AXXXXXX"));
  1291.   #else
  1292.       strcat(arctemp, "$ARCTEMP");
  1293.   #endif
  1294. --- 105,117 ----
  1295.               arctemp[n] = CUTOFF;
  1296.       }
  1297.   #if    !MSDOS
  1298. !     {
  1299. !         static char tempname[] = "AXXXXXX";
  1300. ! #if     UNIX
  1301. !         strcpy(arctemp, "/tmp/");
  1302. ! #endif  /*UNIX*/
  1303. !         strcat(arctemp, mktemp(tempname));
  1304. !     }
  1305.   #else
  1306.       strcat(arctemp, "$ARCTEMP");
  1307.   #endif
  1308. ***************
  1309. *** 109,127 ****
  1310.       arctemp[0] = tmpchr[0];
  1311.   #endif
  1312.   
  1313. !     makefnam(arg[1],".arc",arcname);   /* fix up archive names */
  1314. !     makefnam(arg[2],".arc",srcname);
  1315.   /*    makefnam(".$$$",arcname,newname);*/
  1316.       sprintf(newname,"%s.arc",arctemp);
  1317. - #if    !UNIX
  1318. -     upper(arcname); upper(srcname); upper(newname);
  1319.   #endif
  1320.   
  1321. !     arc = fopen(arcname,"rb");           /* open the archives */
  1322. !     if(!(src=fopen(srcname,"rb")))
  1323.        abort("Cannot read source archive %s",srcname);
  1324. !     if(!(new=fopen(newname,"wb")))
  1325.        abort("Cannot create new archive %s",newname);
  1326.   
  1327.       if(!arc)
  1328. --- 124,149 ----
  1329.       arctemp[0] = tmpchr[0];
  1330.   #endif
  1331.   
  1332. ! #if    UNIX
  1333. !     if (!stat(arg[1],&sbuf))
  1334. !         strcpy(arcname,arg[1]);
  1335. !     else
  1336. !         makefnam(arg[1],".arc",arcname);
  1337. !     if (!stat(arg[2],&sbuf))
  1338. !         strcpy(srcname,arg[2]);
  1339. !     else
  1340. !         makefnam(arg[2],".arc",srcname);
  1341. ! #else
  1342. !     makefnam(arg[1],".ARC",arcname);   /* fix up archive names */
  1343. !     makefnam(arg[2],".ARC",srcname);
  1344.   /*    makefnam(".$$$",arcname,newname);*/
  1345.       sprintf(newname,"%s.arc",arctemp);
  1346.   #endif
  1347.   
  1348. !     arc = fopen(arcname,OPEN_R);           /* open the archives */
  1349. !     if(!(src=fopen(srcname,OPEN_R)))
  1350.        abort("Cannot read source archive %s",srcname);
  1351. !     if(!(new=fopen(newname,OPEN_W)))
  1352.        abort("Cannot create new archive %s",newname);
  1353.   
  1354.       if(!arc)
  1355.