[comp.sources.bugs] Official Patch #1 to Pax

mark@jhereg.Jhereg.MN.ORG (Mark H. Colburn) (02/13/89)

This is the first of three official patches to Pax, a freely distributable 
portable archive interchange.  These patches brings the software upto 
release 1.2.  These patches fix a number of bugs and portability problems 
with the initial release of the software.  These three patches (split to
avoid article size limitations) constitute a single logical patch to pax.

I would like to thank all those people who reported bug, suggested fixes, 
provided patches and suggested other extensions to pax.  I appologize to 
that I was not able to respond to all the mail that I got about pax, but 
all of the problems that were reported have either been fixed, or are 
still under consideration.

Please, if you have any problems with pax, let me know so that they can be
fixed.  Remember, if you find a problem, chances are that others will run
into the same problem as well.  Reporting the problems will allow them to
be fixed to avoid future difficulties and effort.

These items were not fixed in the patch, but are scheduled for a future
patch release:

    * Put the software configuration under control of a "Configure" script ala
      less and rn.
    * Bring source into line with new POSIX 1003.2 description of pax.
    * Add support for undocumented -C flag to cpio.
    * MS-DOS support
    * MINIX support
    * Add missing tar.5 cpio.5 man pages

These items were fixed in these patches:

    * Changed misspelling of MERCHANTABILITY.
    * Changed name of syserr to strerror, warn.c.
    * Removed the references to "public domain" in the software.  The 
      software is copyrighted, not public domain.
    * Files are chmod'ed before being moved into the installation 
      directories.  Files are also copied, then linked in the target 
      directory.
    * The variable "min" in regexp.c was changed to "minimum".  It would 
      seem that some copilers define min to be a macro...
    * In buffer.c there was an integer which was getting assigned NULL, 
      rather than 0.
    * If pax was given the -l option, it only successfully linked the 
      from-file and the to-file together if the from-file is already linked 
      to something else.
    * Changed the verbose output file for tar to use stderr, rather than
      stdout.  The verbose output was being interspersed with the archive,
      causing the archive to be unreadable.
    * The LDFLAGS macro is now used in the makefile.  There are also macros 
      for additional libraries which may be needed and one for SHELL which 
      fixes some problems when using the "make lint" facility.
    * Fixed the stupid typo which caused pax/tar/cpio to run out of file
      descriptors on very deep directory trees.
    * Removed all line continuations "\" in preprocessor directives and
      strings.  These were causing problems on certain compilers.
    * Rename two variable which were colloding on compilers that did not
      understand varaiables that were not unique in the first six
      characters.
    * Change the name of openi().  This causes a lot of problems on some
      machines, especially those with shared libraries...
    * Added some changes required for XENIX 286.
    * All references to NULL are now properly cast.
    * Man pages directories are now more compatible with BSD and USG
      installation
    * Other miscellaneous cleanups.

Mark H. Colburn                  "Look into a child's eye;
Minnetech Consulting, Inc.        there's no hate and there's no lie;
mark@jhereg.mn.org                there's no black and there's no white."
--------------------------------- CUT HERE ---------------------------------

Index: append.c
*** /tmp/,RCSt1a17023	Sun Feb 12 14:05:27 1989
--- append.c	Sun Feb 12 14:01:57 1989
***************
*** 1,6
  /* $Source: /u/mark/src/pax/RCS/append.c,v $
   *
!  * $Revision: 1.1 $
   *
   * append.c - append to a tape archive. 
   *

--- 1,6 -----
  /* $Source: /u/mark/src/pax/RCS/append.c,v $
   *
!  * $Revision: 1.2 $
   *
   * append.c - append to a tape archive. 
   *
***************
*** 27,33
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
   * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
!  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   *
   * $Log:	append.c,v $
   * Revision 1.1  88/12/23  18:02:00  mark

--- 27,33 -----
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
   * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
!  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   *
   * $Log:	append.c,v $
   * Revision 1.2  89/02/12  10:03:58  mark
***************
*** 30,35
   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   *
   * $Log:	append.c,v $
   * Revision 1.1  88/12/23  18:02:00  mark
   * Initial revision
   * 

--- 30,38 -----
   * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   *
   * $Log:	append.c,v $
+  * Revision 1.2  89/02/12  10:03:58  mark
+  * 1.2 release fixes
+  * 
   * Revision 1.1  88/12/23  18:02:00  mark
   * Initial revision
   * 
***************
*** 36,42
   */
  
  #ifndef lint
! static char *ident = "$Id: append.c,v 1.1 88/12/23 18:02:00 mark Rel $";
  static char *copyright = "Copyright (c) 1989 Mark H. Colburn.\nAll rights reserved.\n";
  #endif /* ! lint */
  

--- 39,45 -----
   */
  
  #ifndef lint
! static char *ident = "$Id: append.c,v 1.2 89/02/12 10:03:58 mark Exp $";
  static char *copyright = "Copyright (c) 1989 Mark H. Colburn.\nAll rights reserved.\n";
  #endif /* ! lint */
  
Index: buffer.c
*** /tmp/,RCSt1a17028	Sun Feb 12 14:05:34 1989
--- buffer.c	Sun Feb 12 14:02:00 1989
***************
*** 1,6
  /* $Source: /u/mark/src/pax/RCS/buffer.c,v $
   *
!  * $Revision: 1.1 $
   *
   * buffer.c - Buffer management functions
   *

--- 1,6 -----
  /* $Source: /u/mark/src/pax/RCS/buffer.c,v $
   *
!  * $Revision: 1.2 $
   *
   * buffer.c - Buffer management functions
   *
***************
*** 30,36
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
   * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
!  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   *
   * $Log:	buffer.c,v $
   * Revision 1.1  88/12/23  18:02:01  mark

--- 30,36 -----
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
   * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
!  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   *
   * $Log:	buffer.c,v $
   * Revision 1.2  89/02/12  10:04:02  mark
***************
*** 33,38
   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   *
   * $Log:	buffer.c,v $
   * Revision 1.1  88/12/23  18:02:01  mark
   * Initial revision
   * 

--- 33,41 -----
   * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   *
   * $Log:	buffer.c,v $
+  * Revision 1.2  89/02/12  10:04:02  mark
+  * 1.2 release fixes
+  * 
   * Revision 1.1  88/12/23  18:02:01  mark
   * Initial revision
   * 
***************
*** 39,45
   */
  
  #ifndef lint
! static char *ident = "$Id: buffer.c,v 1.1 88/12/23 18:02:01 mark Rel $";
  static char *copyright = "Copyright (c) 1989 Mark H. Colburn.\nAll rights reserved.\n";
  #endif /* ! lint */
  

--- 42,48 -----
   */
  
  #ifndef lint
! static char *ident = "$Id: buffer.c,v 1.2 89/02/12 10:04:02 mark Exp $";
  static char *copyright = "Copyright (c) 1989 Mark H. Colburn.\nAll rights reserved.\n";
  #endif /* ! lint */
  
***************
*** 114,121
      int             ofd;
      time_t          tstamp[2];
  
!     if ((ofd = openo(name, asb, linkp = linkfrom(name, asb), 0)) > 0) {
! 	if (asb->sb_size || linkp == NULL || linkp->l_size == 0) {
  	    close(indata(ofd, asb->sb_size, name));
  	} else if ((ifd = open(linkp->l_path->p_name, O_RDONLY)) < 0) {
  	    warn(linkp->l_path->p_name, syserr());

--- 117,124 -----
      int             ofd;
      time_t          tstamp[2];
  
!     if ((ofd = openout(name, asb, linkp = linkfrom(name, asb), 0)) > 0) {
! 	if (asb->sb_size || linkp == (Link *)NULL || linkp->l_size == 0) {
  	    close(indata(ofd, asb->sb_size, name));
  	} else if ((ifd = open(linkp->l_path->p_name, O_RDONLY)) < 0) {
  	    warn(linkp->l_path->p_name, strerror());
***************
*** 118,124
  	if (asb->sb_size || linkp == NULL || linkp->l_size == 0) {
  	    close(indata(ofd, asb->sb_size, name));
  	} else if ((ifd = open(linkp->l_path->p_name, O_RDONLY)) < 0) {
! 	    warn(linkp->l_path->p_name, syserr());
  	} else {
  	    passdata(linkp->l_path->p_name, ifd, name, ofd);
  	    close(ifd);

--- 121,127 -----
  	if (asb->sb_size || linkp == (Link *)NULL || linkp->l_size == 0) {
  	    close(indata(ofd, asb->sb_size, name));
  	} else if ((ifd = open(linkp->l_path->p_name, O_RDONLY)) < 0) {
! 	    warn(linkp->l_path->p_name, strerror());
  	} else {
  	    passdata(linkp->l_path->p_name, ifd, name, ofd);
  	    close(ifd);
***************
*** 128,134
  	return(buf_skip((OFFSET) asb->sb_size) >= 0);
      }
      tstamp[0] = (!f_pass && f_access_time) ? asb->sb_atime : time((time_t *) 0);
!     tstamp[1] = f_modification_time ? asb->sb_mtime : time((time_t *) 0);
      utime(name, tstamp);
      return (0);
  }

--- 131,137 -----
  	return(buf_skip((OFFSET) asb->sb_size) >= 0);
      }
      tstamp[0] = (!f_pass && f_access_time) ? asb->sb_atime : time((time_t *) 0);
!     tstamp[1] = f_mtime ? asb->sb_mtime : time((time_t *) 0);
      utime(name, tstamp);
      return (0);
  }
***************
*** 181,187
  	size -= (chunk = size < avail ? (uint) size : avail);
  	if (oops == 0 && (got = read(fd, buf, (unsigned int) chunk)) < 0) {
  	    oops = -1;
! 	    warn(name, syserr());
  	    got = 0;
  	}
  	if (got < chunk) {

--- 184,190 -----
  	size -= (chunk = size < avail ? (uint) size : avail);
  	if (oops == 0 && (got = read(fd, buf, (unsigned int) chunk)) < 0) {
  	    oops = -1;
! 	    warn(name, strerror());
  	    got = 0;
  	}
  	if (got < chunk) {
***************
*** 185,191
  	    got = 0;
  	}
  	if (got < chunk) {
! 	    if (oops == NULL) {
  		oops = -1;
  	    }
  	    warn(name, "Early EOF");

--- 188,194 -----
  	    got = 0;
  	}
  	if (got < chunk) {
! 	    if (oops == 0) {
  		oops = -1;
  	    }
  	    warn(name, "Early EOF");
***************
*** 296,302
   * DESCRIPTION
   *
   *	Copies a file from one place to another.  Doesn't believe in input 
!  *	file descriptor zero (see description of kludge in openi() comments). 
   *	Closes the provided output file descriptor. 
   *
   * PARAMETERS

--- 299,305 -----
   * DESCRIPTION
   *
   *	Copies a file from one place to another.  Doesn't believe in input 
!  *	file descriptor zero (see description of kludge in openin() comments). 
   *	Closes the provided output file descriptor. 
   *
   * PARAMETERS
***************
*** 333,339
  	    total += got;
  	}
  	if (got) {
! 	    warn(got < 0 ? from : to, syserr());
  	} else if (sparse > 0
  		 && (lseek(ofd, (OFFSET)(-sparse), 1) < 0
  		     || write(ofd, block, (uint) sparse) != sparse)) {

--- 336,342 -----
  	    total += got;
  	}
  	if (got) {
! 	    warn(got < 0 ? from : to, strerror());
  	} else if (sparse > 0
  		 && (lseek(ofd, (OFFSET)(-sparse), 1) < 0
  		     || write(ofd, block, (uint) sparse) != sparse)) {
***************
*** 337,343
  	} else if (sparse > 0
  		 && (lseek(ofd, (OFFSET)(-sparse), 1) < 0
  		     || write(ofd, block, (uint) sparse) != sparse)) {
! 	    warn(to, syserr());
  	}
      }
      close(ofd);

--- 340,346 -----
  	} else if (sparse > 0
  		 && (lseek(ofd, (OFFSET)(-sparse), 1) < 0
  		     || write(ofd, block, (uint) sparse) != sparse)) {
! 	    warn(to, strerror());
  	}
      }
      close(ofd);
***************
*** 377,384
  
  #endif
  {
-     extern char *malloc();
-     
      if (size <= 0) {
  	fatal("invalid value for blocksize");
      }

--- 380,385 -----
  
  #endif
  {
      if (size <= 0) {
  	fatal("invalid value for blocksize");
      }
***************
*** 382,388
      if (size <= 0) {
  	fatal("invalid value for blocksize");
      }
!     if ((bufstart = malloc((unsigned) size)) == NULL) {
  	fatal("Cannot allocate I/O buffer");
      }
      bufend = bufidx = bufstart;

--- 383,389 -----
      if (size <= 0) {
  	fatal("invalid value for blocksize");
      }
!     if ((bufstart = malloc((unsigned) size)) == (char *)NULL) {
  	fatal("Cannot allocate I/O buffer");
      }
      bufend = bufidx = bufstart;
***************
*** 534,540
      uint            avail;
  
      corrupt = sparse = 0;
!     oops = NULL;
      while (size) {
  	corrupt |= buf_in_avail(&buf, &avail);
  	size -= (chunk = size < avail ? (uint) size : avail);

--- 535,541 -----
      uint            avail;
  
      corrupt = sparse = 0;
!     oops = (char *)NULL;
      while (size) {
  	corrupt |= buf_in_avail(&buf, &avail);
  	size -= (chunk = size < avail ? (uint) size : avail);
***************
*** 538,545
      while (size) {
  	corrupt |= buf_in_avail(&buf, &avail);
  	size -= (chunk = size < avail ? (uint) size : avail);
! 	if (oops == NULL && (sparse = ar_write(fd, buf, chunk)) < 0) {
! 	    oops = syserr();
  	}
  	buf_use(chunk);
      }

--- 539,546 -----
      while (size) {
  	corrupt |= buf_in_avail(&buf, &avail);
  	size -= (chunk = size < avail ? (uint) size : avail);
! 	if (oops == (char *)NULL && (sparse = ar_write(fd, buf, chunk)) < 0) {
! 	    oops = strerror();
  	}
  	buf_use(chunk);
      }
***************
*** 550,556
  	warn(name, oops);
      } else if (sparse > 0 && (lseek(fd, (OFFSET) - 1, 1) < 0
  			      || write(fd, "", 1) != 1)) {
! 	warn(name, syserr());
      }
      return (fd);
  }

--- 551,557 -----
  	warn(name, oops);
      } else if (sparse > 0 && (lseek(fd, (OFFSET) - 1, 1) < 0
  			      || write(fd, "", 1) != 1)) {
! 	warn(name, strerror());
      }
      return (fd);
  }
***************
*** 630,636
  		bufend += got;
  	    } else if (got < 0) {
  		failed = -1;
! 		warnarch(syserr(), (OFFSET) 0 - (bufend - bufidx));
  	    } else {
  		++areof;
  	    }

--- 631,637 -----
  		bufend += got;
  	    } else if (got < 0) {
  		failed = -1;
! 		warnarch(strerror(), (OFFSET) 0 - (bufend - bufidx));
  	    } else {
  		++areof;
  	    }
Index: config.h
*** /tmp/,RCSt1a17033	Sun Feb 12 14:05:47 1989
--- config.h	Sun Feb 12 14:02:01 1989
***************
*** 1,6
  /* $Source: /u/mark/src/pax/RCS/config.h,v $
   *
!  * $Revision: 1.1 $
   *
   * config.h - configuration options for PAX
   *

--- 1,6 -----
  /* $Source: /u/mark/src/pax/RCS/config.h,v $
   *
!  * $Revision: 1.2 $
   *
   * config.h - configuration options for PAX
   *
***************
*** 28,34
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
   * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
!  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   */
  
  #ifndef _PAX_CONFIG_H

--- 28,34 -----
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
   * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
!  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   */
  
  #ifndef _PAX_CONFIG_H
***************
*** 36,41
  
  /* Defines */
  
  /*
   * USG - USG (Unix System V) specific modifications
   *

--- 36,52 -----
  
  /* Defines */
  
+ /* XENIX_286 (SCO ugh, Xenix system V(?) 286, USG with changes...
+  * You will get a warning about DIRSIZ being redefined, ignore it,
+  * complain to SCO about include files that are messed up or send 
+  * mail to doug@lentni.UUCP, who can provide some patches to fix 
+  * your include files.
+  *
+  * Defining XENIX_286 will automatically define USG.
+  *
+  */
+ #define XENIX_286	/* Running on a XENIX 286 system */
+ 
  /*
   * USG - USG (Unix System V) specific modifications
   *
***************
*** 130,135
  /* #define STRCSPN	/* implementation does not have strcspn() */
  
  /*
   * END OF CONFIGURATION SECTION
   *
   * Nothing beyond this point should need to be changed

--- 141,157 -----
  /* #define STRCSPN	/* implementation does not have strcspn() */
  
  /*
+  * STRERROR - use the strerror function included with pax
+  *
+  * Non-Ansi systems do not have the strerror() function in their C libraries.
+  * For those system define STRERROR and the one provided in misc.c will 
+  * be used instead.
+  */
+ #define STRERROR	/* implementation does not have strerror() */
+ 
+ /*
+ 
+ /*
   * END OF CONFIGURATION SECTION
   *
   * Nothing beyond this point should need to be changed
***************
*** 148,152
  #    define DIRENT
  #  endif
  #endif
  
  #endif /* _PAX_CONFIG_H */

--- 170,178 -----
  #    define DIRENT
  #  endif
  #endif
+ 
+ #ifdef XENIX_286
+ #  define USG
+ #endif /* XENIX_286 */
  
  #endif /* _PAX_CONFIG_H */
Index: cpio.1
*** /tmp/,RCSt1a17038	Sun Feb 12 14:05:54 1989
--- cpio.1	Sun Feb 12 14:02:02 1989
***************
*** 1,4
! .\" $Id: cpio.1,v 1.1 88/12/23 18:02:04 mark Rel $
  .TH CPIO 1 "USENIX Association" ""
  .SH NAME
  cpio \- copy file archives in and out

--- 1,4 -----
! .\" $Id: cpio.1,v 1.2 89/02/12 10:08:42 mark Exp $
  .TH CPIO 1 "USENIX Association" ""
  .SH NAME
  cpio \- copy file archives in and out
***************
*** 254,260
  .PP
  THE SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
! WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  .SH AUTHOR
  Mark H. Colburn
  .br

--- 254,260 -----
  .PP
  THE SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  .SH AUTHOR
  Mark H. Colburn
  .br
Index: cpio.c
*** /tmp/,RCSt1a17043	Sun Feb 12 14:06:01 1989
--- cpio.c	Sun Feb 12 14:02:03 1989
***************
*** 1,6
  /* $Source: /u/mark/src/pax/RCS/cpio.c,v $
   *
!  * $Revision: 1.1 $
   *
   * cpio.c - Cpio specific functions for archive handling
   *

--- 1,6 -----
  /* $Source: /u/mark/src/pax/RCS/cpio.c,v $
   *
!  * $Revision: 1.2 $
   *
   * cpio.c - Cpio specific functions for archive handling
   *
***************
*** 27,33
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
   * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
!  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   *
   * $Log:	cpio.c,v $
   * Revision 1.1  88/12/23  18:02:05  mark

--- 27,33 -----
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
   * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
!  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   *
   * $Log:	cpio.c,v $
   * Revision 1.2  89/02/12  10:04:13  mark
***************
*** 30,35
   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   *
   * $Log:	cpio.c,v $
   * Revision 1.1  88/12/23  18:02:05  mark
   * Initial revision
   * 

--- 30,38 -----
   * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   *
   * $Log:	cpio.c,v $
+  * Revision 1.2  89/02/12  10:04:13  mark
+  * 1.2 release fixes
+  * 
   * Revision 1.1  88/12/23  18:02:05  mark
   * Initial revision
   * 
***************
*** 36,42
   */
  
  #ifndef lint
! static char *ident = "$Id: cpio.c,v 1.1 88/12/23 18:02:05 mark Rel $";
  static char *copyright = "Copyright (c) 1989 Mark H. Colburn.\nAll rights reserved.\n";
  #endif /* ! lint */
  

--- 39,45 -----
   */
  
  #ifndef lint
! static char *ident = "$Id: cpio.c,v 1.2 89/02/12 10:04:13 mark Exp $";
  static char *copyright = "Copyright (c) 1989 Mark H. Colburn.\nAll rights reserved.\n";
  #endif /* ! lint */
  
***************
*** 113,119
  
  	    /* check to make sure that the argument is a directory */
  	    if (LSTAT(dirname, &st) < 0) {
! 		fatal(syserr());
  	    }
  	    if ((st.sb_mode & S_IFMT) != S_IFDIR) {
  		fatal("Not a directory");

--- 116,122 -----
  
  	    /* check to make sure that the argument is a directory */
  	    if (LSTAT(dirname, &st) < 0) {
! 		fatal(strerror());
  	    }
  	    if ((st.sb_mode & S_IFMT) != S_IFDIR) {
  		fatal("Not a directory");
***************
*** 131,137
  	    ar_file = optarg;
  	    break;
  	case 'd':
! 	    f_create_dirs = 1;
  	    break;
  	case 'f':
  	    f_reverse_match = 1;

--- 134,140 -----
  	    ar_file = optarg;
  	    break;
  	case 'd':
! 	    f_dir_create = 1;
  	    break;
  	case 'f':
  	    f_reverse_match = 1;
***************
*** 140,146
  	    f_link = 1;
  	    break;
  	case 'm':
! 	    f_modification_time = 1;
  	    break;
  	case 'r':
  	    f_interactive = 1;

--- 143,149 -----
  	    f_link = 1;
  	    break;
  	case 'm':
! 	    f_mtime = 1;
  	    break;
  	case 'r':
  	    f_interactive = 1;
***************
*** 176,182
      }
  
      /* print out the total block count transfered */
!     fprintf(stderr, "%d Blocks\n", ROUNDUP(total, BLOCKSIZE) / BLOCKSIZE);
      
      exit(0);
      /* NOTREACHED */

--- 179,185 -----
      }
  
      /* print out the total block count transfered */
!     fprintf(stderr, "%ld Blocks\n", ROUNDUP(total, BLOCKSIZE) / BLOCKSIZE);
      
      exit(0);
      /* NOTREACHED */
***************
*** 207,217
  
  #endif
  {
!     fprintf(stderr, "\
! Usage: %s -o[Bacv]\n", myname);
!     fprintf(stderr, "\
!        %s -i[Bcdmrtuvf] [pattern...]\n", myname);
!     fprintf(stderr, "\
!        %s -p[adlmruv] directory\n", myname);
      exit(1);
  }

--- 210,217 -----
  
  #endif
  {
!     fprintf(stderr, "Usage: %s -o[Bacv]\n", myname);
!     fprintf(stderr, "       %s -i[Bcdmrtuvf] [pattern...]\n", myname);
!     fprintf(stderr, "       %s -p[adlmruv] directory\n", myname);
      exit(1);
  }
Index: create.c
*** /tmp/,RCSt1a17048	Sun Feb 12 14:06:10 1989
--- create.c	Sun Feb 12 14:02:05 1989
***************
*** 1,6
  /* $Source: /u/mark/src/pax/RCS/create.c,v $
   *
!  * $Revision: 1.1 $
   *
   * create.c - Create a tape archive. 
   *

--- 1,6 -----
  /* $Source: /u/mark/src/pax/RCS/create.c,v $
   *
!  * $Revision: 1.3 $
   *
   * create.c - Create a tape archive. 
   *
***************
*** 27,33
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
   * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
!  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   *
   * $Log:	create.c,v $
   * Revision 1.1  88/12/23  18:02:06  mark

--- 27,33 -----
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
   * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
!  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   *
   * $Log:	create.c,v $
   * Revision 1.3  89/02/12  10:29:37  mark
***************
*** 30,35
   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   *
   * $Log:	create.c,v $
   * Revision 1.1  88/12/23  18:02:06  mark
   * Initial revision
   * 

--- 30,41 -----
   * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   *
   * $Log:	create.c,v $
+  * Revision 1.3  89/02/12  10:29:37  mark
+  * Fixed misspelling of Replstr
+  * 
+  * Revision 1.2  89/02/12  10:04:17  mark
+  * 1.2 release fixes
+  * 
   * Revision 1.1  88/12/23  18:02:06  mark
   * Initial revision
   * 
***************
*** 36,42
   */
  
  #ifndef lint
! static char *ident = "$Id: create.c,v 1.1 88/12/23 18:02:06 mark Rel $";
  static char *copyright = "Copyright (c) 1989 Mark H. Colburn.\nAll rights reserved.\n";
  #endif /* ! lint */
  

--- 42,48 -----
   */
  
  #ifndef lint
! static char *ident = "$Id: create.c,v 1.3 89/02/12 10:29:37 mark Exp Locker: mark $";
  static char *copyright = "Copyright (c) 1989 Mark H. Colburn.\nAll rights reserved.\n";
  #endif /* ! lint */
  
***************
*** 93,99
      int             fd;
  
      while (name_next(name, &sb) != -1) {
! 	if ((fd = openi(name, &sb)) < 0) {
  	    /* FIXME: pax wants to exit here??? */
  	    continue;
  	}

--- 99,105 -----
      int             fd;
  
      while (name_next(name, &sb) != -1) {
! 	if ((fd = openin(name, &sb)) < 0) {
  	    /* FIXME: pax wants to exit here??? */
  	    continue;
  	}
***************
*** 98,104
  	    continue;
  	}
  
! 	if (rplhead != NULL) {
  	    rpl_name(name);
  	    if (strlen(name) == 0) {
  		continue;

--- 104,110 -----
  	    continue;
  	}
  
! 	if (rplhead != (Replstr *)NULL) {
  	    rpl_name(name);
  	    if (strlen(name) == 0) {
  		continue;
***************
*** 185,191
  #endif
  {
      char	   *p;
!     char           *prefix = NULL;
      int             i;
      int             sum;
      char            hdr[BLOCKSIZE];

--- 191,197 -----
  #endif
  {
      char	   *p;
!     char           *prefix = (char *)NULL;
      int             i;
      int             sum;
      char            hdr[BLOCKSIZE];
***************
*** 230,236
      sprintf(&hdr[136], "%011lo ", (long) asb->sb_mtime);
      strncpy(&hdr[148], "        ", 8);
      hdr[156] = tartype(asb->sb_mode);
!     if (asb->sb_nlink > 1 && (from = linkfrom(name, asb)) != NULL) {
  	strcpy(&hdr[157], from->l_name);
  	hdr[156] = LNKTYPE;
      }

--- 236,242 -----
      sprintf(&hdr[136], "%011lo ", (long) asb->sb_mtime);
      strncpy(&hdr[148], "        ", 8);
      hdr[156] = tartype(asb->sb_mode);
!     if (asb->sb_nlink > 1 && (from = linkfrom(name, asb)) != (Link *)NULL) {
  	strcpy(&hdr[157], from->l_name);
  	hdr[156] = LNKTYPE;
      }
***************
*** 240,246
      strcpy(&hdr[297], findgname((int) asb->sb_gid));
      sprintf(&hdr[329], "%06o \0", major(asb->sb_rdev));
      sprintf(&hdr[337], "%06o \0", minor(asb->sb_rdev));
!     if (prefix != NULL) {
  	strncpy(&hdr[345], prefix, 155);
      }
  

--- 246,252 -----
      strcpy(&hdr[297], findgname((int) asb->sb_gid));
      sprintf(&hdr[329], "%06o \0", major(asb->sb_rdev));
      sprintf(&hdr[337], "%06o \0", minor(asb->sb_rdev));
!     if (prefix != (char *)NULL) {
  	strncpy(&hdr[345], prefix, 155);
      }
  
***************
*** 358,364
  	    USH(asb->sb_uid), USH(asb->sb_gid));
      sprintf(header + M_STRLEN + 30, "%06o%06o%011lo%06o%011lo",
  	    USH(asb->sb_nlink), USH(asb->sb_rdev),
! 	    f_modification_time ? asb->sb_mtime : time((time_t *) 0),
  	    namelen, asb->sb_size);
      outwrite(header, M_STRLEN + H_STRLEN);
      outwrite(name, namelen);

--- 364,370 -----
  	    USH(asb->sb_uid), USH(asb->sb_gid));
      sprintf(header + M_STRLEN + 30, "%06o%06o%011lo%06o%011lo",
  	    USH(asb->sb_nlink), USH(asb->sb_rdev),
! 	    f_mtime ? asb->sb_mtime : time((time_t *) 0),
  	    namelen, asb->sb_size);
      outwrite(header, M_STRLEN + H_STRLEN);
      outwrite(name, namelen);
Index: extract.c
*** /tmp/,RCSt1a17053	Sun Feb 12 14:06:20 1989
--- extract.c	Sun Feb 12 14:02:07 1989
***************
*** 1,6
  /* $Source: /u/mark/src/pax/RCS/extract.c,v $
   *
!  * $Revision: 1.1 $
   *
   * extract.c - Extract files from a tar archive. 
   *

--- 1,6 -----
  /* $Source: /u/mark/src/pax/RCS/extract.c,v $
   *
!  * $Revision: 1.3 $
   *
   * extract.c - Extract files from a tar archive. 
   *
***************
*** 24,30
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
   * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
!  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   *
   * $Log:	extract.c,v $
   * Revision 1.1  88/12/23  18:02:07  mark

--- 24,30 -----
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
   * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
!  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   *
   * $Log:	extract.c,v $
   * Revision 1.3  89/02/12  10:29:43  mark
***************
*** 27,32
   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   *
   * $Log:	extract.c,v $
   * Revision 1.1  88/12/23  18:02:07  mark
   * Initial revision
   * 

--- 27,38 -----
   * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   *
   * $Log:	extract.c,v $
+  * Revision 1.3  89/02/12  10:29:43  mark
+  * Fixed misspelling of Replstr
+  * 
+  * Revision 1.2  89/02/12  10:04:24  mark
+  * 1.2 release fixes
+  * 
   * Revision 1.1  88/12/23  18:02:07  mark
   * Initial revision
   * 
***************
*** 33,39
   */
  
  #ifndef lint
! static char *ident = "$Id: extract.c,v 1.1 88/12/23 18:02:07 mark Rel $";
  static char *copyright = "Copyright (c) 1989 Mark H. Colburn.\nAll rights reserved.\n";
  #endif /* ! lint */
  

--- 39,45 -----
   */
  
  #ifndef lint
! static char *ident = "$Id: extract.c,v 1.3 89/02/12 10:29:43 mark Exp Locker: mark $";
  static char *copyright = "Copyright (c) 1989 Mark H. Colburn.\nAll rights reserved.\n";
  #endif /* ! lint */
  
***************
*** 113,119
  		warn(name, "File data is corrupt");
  	    }
  	} else if (match) {
! 	    if (rplhead != NULL) {
  		rpl_name(name);
  		if (strlen(name) == 0) {
  		    continue;

--- 119,125 -----
  		warn(name, "File data is corrupt");
  	    }
  	} else if (match) {
! 	    if (rplhead != (Replstr *)NULL) {
  		rpl_name(name);
  		if (strlen(name) == 0) {
  		    continue;
Index: fileio.c
*** /tmp/,RCSt1a17058	Sun Feb 12 14:06:30 1989
--- fileio.c	Sun Feb 12 14:02:08 1989
***************
*** 1,6
  /* $Source: /u/mark/src/pax/RCS/fileio.c,v $
   *
!  * $Revision: 1.1 $
   *
   * fileio.c - file I/O functions for all archive interfaces
   *

--- 1,6 -----
  /* $Source: /u/mark/src/pax/RCS/fileio.c,v $
   *
!  * $Revision: 1.2 $
   *
   * fileio.c - file I/O functions for all archive interfaces
   *
***************
*** 27,33
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
   * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
!  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   *
   * $Log:	fileio.c,v $
   * Revision 1.1  88/12/23  18:02:09  mark

--- 27,33 -----
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
   * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
!  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   *
   * $Log:	fileio.c,v $
   * Revision 1.2  89/02/12  10:04:31  mark
***************
*** 30,35
   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   *
   * $Log:	fileio.c,v $
   * Revision 1.1  88/12/23  18:02:09  mark
   * Initial revision
   * 

--- 30,38 -----
   * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   *
   * $Log:	fileio.c,v $
+  * Revision 1.2  89/02/12  10:04:31  mark
+  * 1.2 release fixes
+  * 
   * Revision 1.1  88/12/23  18:02:09  mark
   * Initial revision
   * 
***************
*** 36,42
   */
  
  #ifndef lint
! static char *ident = "$Id: fileio.c,v 1.1 88/12/23 18:02:09 mark Rel $";
  static char *copyright = "Copyright (c) 1989 Mark H. Colburn.\nAll rights reserved.\n";
  #endif /* ! lint */
  

--- 39,45 -----
   */
  
  #ifndef lint
! static char *ident = "$Id: fileio.c,v 1.2 89/02/12 10:04:31 mark Exp $";
  static char *copyright = "Copyright (c) 1989 Mark H. Colburn.\nAll rights reserved.\n";
  #endif /* ! lint */
  
***************
*** 94,100
      }
  
      if (archivefd < 0) {
! 	warnarch(syserr(), (OFFSET) 0);
  	return (-1);
      }
      ++arvolume;

--- 97,103 -----
      }
  
      if (archivefd < 0) {
! 	warnarch(strerror(), (OFFSET) 0);
  	return (-1);
      }
      ++arvolume;
***************
*** 127,133
  }
  
  
! /* openo - open an output file
   *
   * DESCRIPTION
   *

--- 130,136 -----
  }
  
  
! /* openout - open an output file
   *
   * DESCRIPTION
   *
***************
*** 153,159
  
  #ifdef __STDC__
  
! int openo(char *name, Stat *asb, Link *linkp, int ispass)
  
  #else
      

--- 156,162 -----
  
  #ifdef __STDC__
  
! int openout(char *name, Stat *asb, Link *linkp, int ispass)
  
  #else
      
***************
*** 157,163
  
  #else
      
! int openo(name, asb, linkp, ispass)
  char           *name;
  Stat           *asb;
  Link           *linkp;

--- 160,166 -----
  
  #else
      
! int openout(name, asb, linkp, ispass)
  char           *name;
  Stat           *asb;
  Link           *linkp;
***************
*** 182,188
  	} else if ((osb.sb_mode & S_IFMT) == (asb->sb_mode & S_IFMT)) {
  	    operm = osb.sb_mode & S_IPERM;
  	} else if (REMOVE(name, &osb) < 0) {
! 	    warn(name, syserr());
  	    return (-1);
  	} else {
  	    exists = 0;

--- 185,191 -----
  	} else if ((osb.sb_mode & S_IFMT) == (asb->sb_mode & S_IFMT)) {
  	    operm = osb.sb_mode & S_IPERM;
  	} else if (REMOVE(name, &osb) < 0) {
! 	    warn(name, strerror());
  	    return (-1);
  	} else {
  	    exists = 0;
***************
*** 193,199
  	    if (asb->sb_ino == osb.sb_ino && asb->sb_dev == osb.sb_dev) {
  		return (0);
  	    } else if (unlink(name) < 0) {
! 		warn(name, syserr());
  		return (-1);
  	    } else {
  		exists = 0;

--- 196,202 -----
  	    if (asb->sb_ino == osb.sb_ino && asb->sb_dev == osb.sb_dev) {
  		return (0);
  	    } else if (unlink(name) < 0) {
! 		warn(name, strerror());
  		return (-1);
  	    } else {
  		exists = 0;
***************
*** 201,207
  	}
  	if (link(linkp->l_name, name) != 0) {
  	    if (errno == ENOENT) {
! 		if (f_create_dirs) {
  		    if (dirneed(name) != 0 ||
  			    link(linkp->l_name, name) != 0) {
  			    warn(name, syserr());

--- 204,210 -----
  	}
  	if (link(linkp->l_name, name) != 0) {
  	    if (errno == ENOENT) {
! 		if (f_dir_create) {
  		    if (dirneed(name) != 0 ||
  			    link(linkp->l_name, name) != 0) {
  			    warn(name, strerror());
***************
*** 204,210
  		if (f_create_dirs) {
  		    if (dirneed(name) != 0 ||
  			    link(linkp->l_name, name) != 0) {
! 			    warn(name, syserr());
  			return (-1);
  		    }
  		} else {

--- 207,213 -----
  		if (f_dir_create) {
  		    if (dirneed(name) != 0 ||
  			    link(linkp->l_name, name) != 0) {
! 			    warn(name, strerror());
  			return (-1);
  		    }
  		} else {
***************
*** 213,219
  		}
  		return(0);
  	    } else if (errno != EXDEV) {
! 		warn(name, syserr());
  		return (-1);
  	    }
  	} else {

--- 216,222 -----
  		}
  		return(0);
  	    } else if (errno != EXDEV) {
! 		warn(name, strerror());
  		return (-1);
  	    }
  	} else {
***************
*** 228,234
  	if (exists) {
  	    if (asb->sb_rdev == osb.sb_rdev) {
  		if (perm != operm && chmod(name, (int) perm) < 0) {
! 		    warn(name, syserr());
  		    return (-1);
  		} else {
  		    break;

--- 231,237 -----
  	if (exists) {
  	    if (asb->sb_rdev == osb.sb_rdev) {
  		if (perm != operm && chmod(name, (int) perm) < 0) {
! 		    warn(name, strerror());
  		    return (-1);
  		} else {
  		    break;
***************
*** 234,240
  		    break;
  		}
  	    } else if (REMOVE(name, &osb) < 0) {
! 		warn(name, syserr());
  		return (-1);
  	    } else {
  		exists = 0;

--- 237,243 -----
  		    break;
  		}
  	    } else if (REMOVE(name, &osb) < 0) {
! 		warn(name, strerror());
  		return (-1);
  	    } else {
  		exists = 0;
***************
*** 242,248
  	}
  	if (mknod(name, (int) asb->sb_mode, (int) asb->sb_rdev) < 0) {
  	    if (errno == ENOENT) {
! 		if (f_create_dirs) {
  		    if (dirneed(name) < 0 || mknod(name, (int) asb->sb_mode, 
  			   (int) asb->sb_rdev) < 0) {
  			warn(name, syserr());

--- 245,251 -----
  	}
  	if (mknod(name, (int) asb->sb_mode, (int) asb->sb_rdev) < 0) {
  	    if (errno == ENOENT) {
! 		if (f_dir_create) {
  		    if (dirneed(name) < 0 || mknod(name, (int) asb->sb_mode, 
  			   (int) asb->sb_rdev) < 0) {
  			warn(name, strerror());
***************
*** 245,251
  		if (f_create_dirs) {
  		    if (dirneed(name) < 0 || mknod(name, (int) asb->sb_mode, 
  			   (int) asb->sb_rdev) < 0) {
! 			warn(name, syserr());
  			return (-1);
  		    }
  		} else {

--- 248,254 -----
  		if (f_dir_create) {
  		    if (dirneed(name) < 0 || mknod(name, (int) asb->sb_mode, 
  			   (int) asb->sb_rdev) < 0) {
! 			warn(name, strerror());
  			return (-1);
  		    }
  		} else {
***************
*** 252,258
  		    warn(name, "Directories are not being created (-d option)");
  		}
  	    } else {
! 		warn(name, syserr());
  		return (-1);
  	    }
  	}

--- 255,261 -----
  		    warn(name, "Directories are not being created (-d option)");
  		}
  	    } else {
! 		warn(name, strerror());
  		return (-1);
  	    }
  	}
***************
*** 261,267
      case S_IFDIR:
  	if (exists) {
  	    if (perm != operm && chmod(name, (int) perm) < 0) {
! 		warn(name, syserr());
  		return (-1);
  	    }
  	} else if (f_create_dirs) {

--- 264,270 -----
      case S_IFDIR:
  	if (exists) {
  	    if (perm != operm && chmod(name, (int) perm) < 0) {
! 		warn(name, strerror());
  		return (-1);
  	    }
  	} else if (f_dir_create) {
***************
*** 264,270
  		warn(name, syserr());
  		return (-1);
  	    }
! 	} else if (f_create_dirs) {
  	    if (dirmake(name, asb) < 0 || dirneed(name) < 0) {
  		warn(name, syserr());
  		return (-1);

--- 267,273 -----
  		warn(name, strerror());
  		return (-1);
  	    }
! 	} else if (f_dir_create) {
  	    if (dirmake(name, asb) < 0 || dirneed(name) < 0) {
  		warn(name, strerror());
  		return (-1);
***************
*** 266,272
  	    }
  	} else if (f_create_dirs) {
  	    if (dirmake(name, asb) < 0 || dirneed(name) < 0) {
! 		warn(name, syserr());
  		return (-1);
  	    }
  	} else {

--- 269,275 -----
  	    }
  	} else if (f_dir_create) {
  	    if (dirmake(name, asb) < 0 || dirneed(name) < 0) {
! 		warn(name, strerror());
  		return (-1);
  	    }
  	} else {
***************
*** 278,284
  	fd = 0;
  	if (exists) {
  	    if (perm != operm && chmod(name, (int) perm) < 0) {
! 		warn(name, syserr());
  		return (-1);
  	    }
  	} else if (mknod(name, (int) asb->sb_mode, 0) < 0) {

--- 281,287 -----
  	fd = 0;
  	if (exists) {
  	    if (perm != operm && chmod(name, (int) perm) < 0) {
! 		warn(name, strerror());
  		return (-1);
  	    }
  	} else if (mknod(name, (int) asb->sb_mode, 0) < 0) {
***************
*** 283,289
  	    }
  	} else if (mknod(name, (int) asb->sb_mode, 0) < 0) {
  	    if (errno == ENOENT) {
! 		if (f_create_dirs) {
  		    if (dirneed(name) < 0
  		       || mknod(name, (int) asb->sb_mode, 0) < 0) {
  			warn(name, syserr());

--- 286,292 -----
  	    }
  	} else if (mknod(name, (int) asb->sb_mode, 0) < 0) {
  	    if (errno == ENOENT) {
! 		if (f_dir_create) {
  		    if (dirneed(name) < 0
  		       || mknod(name, (int) asb->sb_mode, 0) < 0) {
  			warn(name, strerror());
***************
*** 286,292
  		if (f_create_dirs) {
  		    if (dirneed(name) < 0
  		       || mknod(name, (int) asb->sb_mode, 0) < 0) {
! 			warn(name, syserr());
  			return (-1);
  		    }
  		} else {

--- 289,295 -----
  		if (f_dir_create) {
  		    if (dirneed(name) < 0
  		       || mknod(name, (int) asb->sb_mode, 0) < 0) {
! 			warn(name, strerror());
  			return (-1);
  		    }
  		} else {
***************
*** 293,299
  		    warn(name, "Directories are not being created (-d option)");
  		}
  	    } else {
! 		warn(name, syserr());
  		return (-1);
  	    }
  	}

--- 296,302 -----
  		    warn(name, "Directories are not being created (-d option)");
  		}
  	    } else {
! 		warn(name, strerror());
  		return (-1);
  	    }
  	}
***************
*** 304,310
      case S_IFLNK:
  	if (exists) {
  	    if ((ssize = readlink(name, sname, sizeof(sname))) < 0) {
! 		warn(name, syserr());
  		return (-1);
  	    } else if (strncmp(sname, asb->sb_link, ssize) == 0) {
  		return (0);

--- 307,313 -----
      case S_IFLNK:
  	if (exists) {
  	    if ((ssize = readlink(name, sname, sizeof(sname))) < 0) {
! 		warn(name, strerror());
  		return (-1);
  	    } else if (strncmp(sname, asb->sb_link, ssize) == 0) {
  		return (0);
***************
*** 309,315
  	    } else if (strncmp(sname, asb->sb_link, ssize) == 0) {
  		return (0);
  	    } else if (REMOVE(name, &osb) < 0) {
! 		warn(name, syserr());
  		return (-1);
  	    } else {
  		exists = 0;

--- 312,318 -----
  	    } else if (strncmp(sname, asb->sb_link, ssize) == 0) {
  		return (0);
  	    } else if (REMOVE(name, &osb) < 0) {
! 		warn(name, strerror());
  		return (-1);
  	    } else {
  		exists = 0;
***************
*** 317,323
  	}
  	if (symlink(asb->sb_link, name) < 0) {
  	    if (errno == ENOENT) {
! 		if (f_create_dirs) {
  		    if (dirneed(name) < 0 || symlink(asb->sb_link, name) < 0) {
  			warn(name, syserr());
  			return (-1);

--- 320,326 -----
  	}
  	if (symlink(asb->sb_link, name) < 0) {
  	    if (errno == ENOENT) {
! 		if (f_dir_create) {
  		    if (dirneed(name) < 0 || symlink(asb->sb_link, name) < 0) {
  			warn(name, strerror());
  			return (-1);
***************
*** 319,325
  	    if (errno == ENOENT) {
  		if (f_create_dirs) {
  		    if (dirneed(name) < 0 || symlink(asb->sb_link, name) < 0) {
! 			warn(name, syserr());
  			return (-1);
  		    }
  		} else {

--- 322,328 -----
  	    if (errno == ENOENT) {
  		if (f_dir_create) {
  		    if (dirneed(name) < 0 || symlink(asb->sb_link, name) < 0) {
! 			warn(name, strerror());
  			return (-1);
  		    }
  		} else {
***************
*** 326,332
  		    warn(name, "Directories are not being created (-d option)");
  		}
  	    } else {
! 		warn(name, syserr());
  		return (-1);
  	    }
  	}

--- 329,335 -----
  		    warn(name, "Directories are not being created (-d option)");
  		}
  	    } else {
! 		warn(name, strerror());
  		return (-1);
  	    }
  	}
***************
*** 338,344
  		warn(name, "Newer file exists");
  		return (-1);
  	    } else if (unlink(name) < 0) {
! 		warn(name, syserr());
  		return (-1);
  	    } else {
  		exists = 0;

--- 341,347 -----
  		warn(name, "Newer file exists");
  		return (-1);
  	    } else if (unlink(name) < 0) {
! 		warn(name, strerror());
  		return (-1);
  	    } else {
  		exists = 0;
***************
*** 346,352
  	}
  	if ((fd = creat(name, (int) perm)) < 0) {
  	    if (errno == ENOENT) {
! 		if (f_create_dirs) {
  		    if (dirneed(name) < 0 || 
  			    (fd = creat(name, (int) perm)) < 0) {
  			warn(name, syserr());

--- 349,355 -----
  	}
  	if ((fd = creat(name, (int) perm)) < 0) {
  	    if (errno == ENOENT) {
! 		if (f_dir_create) {
  		    if (dirneed(name) < 0 || 
  			    (fd = creat(name, (int) perm)) < 0) {
  			warn(name, strerror());
***************
*** 349,355
  		if (f_create_dirs) {
  		    if (dirneed(name) < 0 || 
  			    (fd = creat(name, (int) perm)) < 0) {
! 			warn(name, syserr());
  			return (-1);
  		    }
  		} else {

--- 352,358 -----
  		if (f_dir_create) {
  		    if (dirneed(name) < 0 || 
  			    (fd = creat(name, (int) perm)) < 0) {
! 			warn(name, strerror());
  			return (-1);
  		    }
  		} else {
***************
*** 362,368
  		    return(0);
  		}
  	    } else {
! 		warn(name, syserr());
  		return (-1);
  	    }
  	}

--- 365,371 -----
  		    return(0);
  		}
  	    } else {
! 		warn(name, strerror());
  		return (-1);
  	    }
  	}
***************
*** 380,386
  }
  
  
! /* openi - open the next input file
   *
   * DESCRIPTION
   *

--- 383,389 -----
  }
  
  
! /* openin - open the next input file
   *
   * DESCRIPTION
   *
***************
*** 407,413
  
  #ifdef __STDC__
  
! int openi(char *name, Stat *asb)
  
  #else
      

--- 410,416 -----
  
  #ifdef __STDC__
  
! int openin(char *name, Stat *asb)
  
  #else
      
***************
*** 411,417
  
  #else
      
! int openi(name, asb)
  char           *name;		/* name of file to open */
  Stat           *asb;		/* pointer to stat structure for file */
  

--- 414,420 -----
  
  #else
      
! int openin(name, asb)
  char           *name;		/* name of file to open */
  Stat           *asb;		/* pointer to stat structure for file */
  
***************
*** 428,434
      case S_IFLNK:
  	if ((asb->sb_size = readlink(name,
  			     asb->sb_link, sizeof(asb->sb_link) - 1)) < 0) {
! 	    warn(name, syserr());
  	    return(0);
  	}
  	asb->sb_link[asb->sb_size] = '\0';

--- 431,437 -----
      case S_IFLNK:
  	if ((asb->sb_size = readlink(name,
  			     asb->sb_link, sizeof(asb->sb_link) - 1)) < 0) {
! 	    warn(name, strerror());
  	    return(0);
  	}
  	asb->sb_link[asb->sb_size] = '\0';
***************
*** 439,445
  	    return (0);
  	}
  	if ((fd = open(name, O_RDONLY | O_BINARY)) < 0) {
! 	    warn(name, syserr());
  	}
  	return (fd);
      default:

--- 442,448 -----
  	    return (0);
  	}
  	if ((fd = open(name, O_RDONLY | O_BINARY)) < 0) {
! 	    warn(name, strerror());
  	}
  	return (fd);
      default:
Index: func.h
*** /tmp/,RCSt1a17063	Sun Feb 12 14:06:40 1989
--- func.h	Sun Feb 12 14:02:09 1989
***************
*** 1,6
  /* $Source: /u/mark/src/pax/RCS/func.h,v $
   *
!  * $Revision: 1.1 $
   *
   * func.h - function type and argument declarations
   *

--- 1,6 -----
  /* $Source: /u/mark/src/pax/RCS/func.h,v $
   *
!  * $Revision: 1.3 $
   *
   * func.h - function type and argument declarations
   *
***************
*** 27,33
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
   * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
!  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   */
  
  #ifndef _PAX_FUNC_H

--- 27,33 -----
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
   * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
!  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   */
  
  #ifndef _PAX_FUNC_H
***************
*** 41,47
  extern Link    	       *linkto(char *, Stat *);
  extern char    	       *mem_get(uint);
  extern char    	       *mem_str(char *);
! extern char    	       *syserr(void);
  extern int      	ar_read(void);
  extern int      	buf_read(char *, uint);
  extern int      	buf_skip(OFFSET);

--- 41,47 -----
  extern Link    	       *linkto(char *, Stat *);
  extern char    	       *mem_get(uint);
  extern char    	       *mem_str(char *);
! extern char    	       *strerror(void);
  extern int      	ar_read(void);
  extern int      	buf_read(char *, uint);
  extern int      	buf_skip(OFFSET);
***************
*** 55,62
  extern int      	nameopt(char *);
  extern int      	open_archive(int);
  extern int      	open_tty(void);
! extern int      	openi(char *, Stat *);
! extern int      	openo(char *, Stat *, Link *, int);
  extern int      	pass(char *);
  extern int      	passitem(char *, Stat *, int, char *);
  extern int      	read_header(char *, Stat *);

--- 55,62 -----
  extern int      	nameopt(char *);
  extern int      	open_archive(int);
  extern int      	open_tty(void);
! extern int      	openin(char *, Stat *);
! extern int      	openout(char *, Stat *, Link *, int);
  extern int      	pass(char *);
  extern int      	passitem(char *, Stat *, int, char *);
  extern int      	read_header(char *, Stat *);
***************
*** 86,91
  extern char            *finduname(int);
  extern char            *findgname(int);
  extern int		findgid(char *gname);
  
  #else /* !__STDC__ */
  

--- 86,92 -----
  extern char            *finduname(int);
  extern char            *findgname(int);
  extern int		findgid(char *gname);
+ extern char    	       *malloc();
  
  #else /* !__STDC__ */
  
***************
*** 93,99
  extern Link    	       *linkto();
  extern char    	       *mem_get();
  extern char    	       *mem_str();
! extern char    	       *syserr();
  extern int      	ar_read();
  extern int      	buf_read();
  extern int      	buf_skip();

--- 94,100 -----
  extern Link    	       *linkto();
  extern char    	       *mem_get();
  extern char    	       *mem_str();
! extern char    	       *strerror();
  extern int      	ar_read();
  extern int      	buf_read();
  extern int      	buf_skip();
***************
*** 107,114
  extern int      	nameopt();
  extern int      	open_archive();
  extern int      	open_tty();
! extern int      	openi();
! extern int      	openo();
  extern int      	pass();
  extern int      	passitem();
  extern int     	 	read_header();

--- 108,115 -----
  extern int      	nameopt();
  extern int      	open_archive();
  extern int      	open_tty();
! extern int      	openin();
! extern int      	openout();
  extern int      	pass();
  extern int      	passitem();
  extern int     	 	read_header();
Index: limits.h
*** /tmp/,RCSt1a17068	Sun Feb 12 14:06:46 1989
--- limits.h	Sun Feb 12 14:02:10 1989
***************
*** 1,6
  /* $Source: /u/mark/src/pax/RCS/limits.h,v $
   *
!  * $Revision: 1.1 $
   *
   * 	limits.h - POSIX compatible defnitions for some of <limits.h>
   *

--- 1,6 -----
  /* $Source: /u/mark/src/pax/RCS/limits.h,v $
   *
!  * $Revision: 1.2 $
   *
   * 	limits.h - POSIX compatible defnitions for some of <limits.h>
   *
***************
*** 37,43
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
   * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
!  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   */
  
  #ifndef _PAX_LIMITS_H

--- 37,43 -----
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
   * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
!  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   */
  
  #ifndef _PAX_LIMITS_H
Index: link.c
*** /tmp/,RCSt1a17073	Sun Feb 12 14:06:52 1989
--- link.c	Sun Feb 12 14:02:11 1989
***************
*** 1,6
  /* $Source: /u/mark/src/pax/RCS/link.c,v $
   *
!  * $Revision: 1.1 $
   *
   * link.c - functions for handling multiple file links 
   *

--- 1,6 -----
  /* $Source: /u/mark/src/pax/RCS/link.c,v $
   *
!  * $Revision: 1.2 $
   *
   * link.c - functions for handling multiple file links 
   *
***************
*** 27,33
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
   * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
!  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   *
   * $Log:	link.c,v $
   * Revision 1.1  88/12/23  18:02:12  mark

--- 27,33 -----
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
   * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
!  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   *
   * $Log:	link.c,v $
   * Revision 1.2  89/02/12  10:04:38  mark
***************
*** 30,35
   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   *
   * $Log:	link.c,v $
   * Revision 1.1  88/12/23  18:02:12  mark
   * Initial revision
   * 

--- 30,38 -----
   * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   *
   * $Log:	link.c,v $
+  * Revision 1.2  89/02/12  10:04:38  mark
+  * 1.2 release fixes
+  * 
   * Revision 1.1  88/12/23  18:02:12  mark
   * Initial revision
   * 
***************
*** 36,42
   */
  
  #ifndef lint
! static char *ident = "$Id: link.c,v 1.1 88/12/23 18:02:12 mark Rel $";
  static char *copyright = "Copyright (c) 1989 Mark H. Colburn.\nAll rights reserved.\n";
  #endif /* ! lint */
  

--- 39,45 -----
   */
  
  #ifndef lint
! static char *ident = "$Id: link.c,v 1.2 89/02/12 10:04:38 mark Exp $";
  static char *copyright = "Copyright (c) 1989 Mark H. Colburn.\nAll rights reserved.\n";
  #endif /* ! lint */
  
***************
*** 116,122
  		linkp->l_back->l_forw = linkp->l_forw;
  	    }
  	    free((char *) linkp);
! 	    *abase = (Link *) NULL;
  	} else if (linkp->l_ino == asb->sb_ino && linkp->l_dev == asb->sb_dev) {
  	    /* 
  	     * check to see if a file with the name "name" exists in the 

--- 119,125 -----
  		linkp->l_back->l_forw = linkp->l_forw;
  	    }
  	    free((char *) linkp);
! 	    *abase = (Link *)NULL;
  	} else if (linkp->l_ino == asb->sb_ino && linkp->l_dev == asb->sb_dev) {
  	    /* 
  	     * check to see if a file with the name "name" exists in the 
***************
*** 191,197
      for (linkp = *(LINKHASH(asb->sb_ino)); linkp; linkp = linknext) {
  	if (linkp->l_ino == asb->sb_ino && linkp->l_dev == asb->sb_dev) {
  	    if (strcmp(name, linkp->l_name) == 0) {
! 		return ((Link *) NULL);
  	    } 
  	    return (linkp);
  	} else {

--- 194,200 -----
      for (linkp = *(LINKHASH(asb->sb_ino)); linkp; linkp = linknext) {
  	if (linkp->l_ino == asb->sb_ino && linkp->l_dev == asb->sb_dev) {
  	    if (strcmp(name, linkp->l_name) == 0) {
! 		return ((Link *)NULL);
  	    } 
  	    return (linkp);
  	} else {
***************
*** 243,251
  
      for (linkp = *(LINKHASH(asb->sb_ino)); linkp; linkp = linknext) {
  	if (linkp->l_ino == asb->sb_ino && linkp->l_dev == asb->sb_dev) {
! 	    if ((path = (Path *) mem_get(sizeof(Path))) == (Path *) NULL || 
! 		(path->p_name = mem_str(name)) == (char *) NULL) {
! 		return((Link *) NULL);
  	    }
  	    if (path->p_forw = linkp->l_path) {
  		if (linkp->l_path->p_forw) {

--- 246,254 -----
  
      for (linkp = *(LINKHASH(asb->sb_ino)); linkp; linkp = linknext) {
  	if (linkp->l_ino == asb->sb_ino && linkp->l_dev == asb->sb_dev) {
! 	    if ((path = (Path *) mem_get(sizeof(Path))) == (Path *)NULL || 
! 		(path->p_name = mem_str(name)) == (char *)NULL) {
! 		return((Link *)NULL);
  	    }
  	    if (path->p_forw = linkp->l_path) {
  		if (linkp->l_path->p_forw) {
***************
*** 254,260
  	    } else {
  		linkp->l_path = path;
  	    }
! 	    path->p_back = (Path *) NULL;
  	    return(linkp);
  	} else {
  	    linknext = linkp->l_forw;

--- 257,263 -----
  	    } else {
  		linkp->l_path = path;
  	    }
! 	    path->p_back = (Path *)NULL;
  	    return(linkp);
  	} else {
  	    linknext = linkp->l_forw;
***************
*** 265,273
       */
  
      if ((asb->sb_mode & S_IFMT) == S_IFDIR
! 	|| (linkp = (Link *) mem_get(sizeof(Link))) == NULL
! 	|| (linkp->l_name = mem_str(name)) == NULL) {
! 	return ((Link *) NULL);
      }
      linkp->l_dev = asb->sb_dev;
      linkp->l_ino = asb->sb_ino;

--- 268,276 -----
       */
  
      if ((asb->sb_mode & S_IFMT) == S_IFDIR
! 	|| (linkp = (Link *) mem_get(sizeof(Link))) == (Link *)NULL
! 	|| (linkp->l_name = mem_str(name)) == (char *)NULL) {
! 	return ((Link *)NULL);
      }
      linkp->l_dev = asb->sb_dev;
      linkp->l_ino = asb->sb_ino;
***************
*** 273,279
      linkp->l_ino = asb->sb_ino;
      linkp->l_nlink = asb->sb_nlink - 1;
      linkp->l_size = asb->sb_size;
!     linkp->l_path = (Path *) NULL;
      if (linkp->l_forw = *(abase = LINKHASH(asb->sb_ino))) {
  	linkp->l_forw->l_back = linkp;
      } else {

--- 276,282 -----
      linkp->l_ino = asb->sb_ino;
      linkp->l_nlink = asb->sb_nlink - 1;
      linkp->l_size = asb->sb_size;
!     linkp->l_path = (Path *)NULL;
      if (linkp->l_forw = *(abase = LINKHASH(asb->sb_ino))) {
  	linkp->l_forw->l_back = linkp;
      } else {
***************
*** 279,285
      } else {
  	*abase = linkp;
      }
!     linkp->l_back = NULL;
      return (linkp);
  }
  

--- 282,288 -----
      } else {
  	*abase = linkp;
      }
!     linkp->l_back = (Link *)NULL;
      return (linkp);
  }
  
-- 
Mark H. Colburn                  "Look into a child's eye;
Minnetech Consulting, Inc.        there's no hate and there's no lie;
mark@jhereg.mn.org                there's no black and there's no white."