Subject: bin/20164: pax(1) is full of typos
To: None <gnats-bugs@gnats.netbsd.org>
From: None <svs+pr@grep.ru>
List: netbsd-bugs
Date: 02/01/2003 21:47:38
>Number:         20164
>Category:       bin
>Synopsis:       pax(1) is full of typos
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Feb 01 21:48:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Sergey Svishchev
>Release:        1.6L
>Organization:
>Environment:
>Description:
Lots of typos in comments.

>How-To-Repeat:

>Fix:
Index: ar_io.c
===================================================================
RCS file: /cvsroot/src/bin/pax/ar_io.c,v
retrieving revision 1.30
diff -u -r1.30 ar_io.c
--- ar_io.c 2002/12/12 05:00:42 1.30    
+++ ar_io.c 2003/02/02 04:33:38
@@ -257,7 +257,7 @@
   * set default blksz on read. APPNDs writes rdblksz on the last volume
   * On all new archive volumes, we shift to wrblksz (if the user
   * specified one, otherwize we will continue to use rdblksz). We
-  * must to set blocksize based on what kind of device the archive is
+  * must set blocksize based on what kind of device the archive is
   * stored.
   */    
  switch(artyp) {
@@ -337,7 +337,7 @@
    break;      
  default:
    /*
-    * should never happen, worse case, slow...
+    * should never happen, worst case, slow...
     */
    blksz = rdblksz = BLKMULT;
    break;      
@@ -747,10 +747,10 @@
      io_ok = 1;
      if (res != rdblksz) {
        /* 
-        * Record size changed. If this is happens on
+        * Record size changed. If this happens on
         * any record after the first, we probably have
         * a tape drive which has a fixed record size
-        * we are getting multiple records in a single
+        * (we are getting multiple records in a single
         * read). Watch out for record blocking that
         * violates pax spec (must be a multiple of
         * BLKMULT).
@@ -936,7 +936,7 @@
  struct mtop mb;
  
  /*
-  * Fail resync attempts at user request (done) or this is going to be
+  * Fail resync attempts at user request (done) or if this is going to be
   * an update/append to a existing archive. if last i/o hit media end,
   * we need to go to the next volume not try a resync
   */
@@ -1137,8 +1137,8 @@

    /*
     * we may try to go backwards past the start when the archive
-    * is only a single record. If this hapens and we are on a
-    * multi volume archive, we need to go to the end of the
+    * is only a single record. If this happens and we are on a
+    * multi-volume archive, we need to go to the end of the
     * previous volume and continue our movement backwards from
     * there.
     */
@@ -1168,7 +1168,7 @@
     * Calculate and move the proper number of PHYSICAL tape
     * blocks. If the sksz is not an even multiple of the physical
     * tape size, we cannot do the move (this should never happen).
-    * (We also cannot handler trailers spread over two vols).
+    * (We also cannot handle trailers spread over two vols).
     * get_phys() also makes sure we are in front of the filemark.
     */
    if ((phyblk = get_phys()) <= 0) {
Index: ar_subs.c
===================================================================
RCS file: /cvsroot/src/bin/pax/ar_subs.c,v
retrieving revision 1.21
diff -u -r1.21 ar_subs.c
--- ar_subs.c 2002/12/10 18:33:26 1.21
+++ ar_subs.c 2003/02/02 04:33:45
@@ -79,7 +79,7 @@
 /*
  * list()
  * list the contents of an archive which match user supplied pattern(s)
- * (no pattern matches all).
+ * (if no pattern is supplied, list entire contents).
  */

 void
@@ -234,7 +234,7 @@

    /*
     * with -u or -D only extract when the archive member is newer
-    * than the file with the same name in the file system (nos
+    * than the file with the same name in the file system (no
     * test of being the same type is required).
     * NOTE: this test is done BEFORE name modifications as
     * specified by pax. this operation can be confusing to the
@@ -420,7 +420,7 @@
    return;

  /*
-  * if this not append, and there are no files, we do no write a trailer
+  * if this is not append, and there are no files, we do no write a trailer
   */
  wr_one = is_app;
   
Index: buf_subs.c
===================================================================
RCS file: /cvsroot/src/bin/pax/buf_subs.c,v
retrieving revision 1.17
diff -u -r1.17 buf_subs.c
--- buf_subs.c  2002/01/31 19:27:53 1.17
+++ buf_subs.c  2003/02/02 04:33:52
@@ -203,9 +203,9 @@
  * start of this record so a flush of this buffer will replace the record
  * in the archive.
  * A major problem is rewriting this last record. For archives stored
- * on disk files, this is trival. However, many devices are really picky
+ * on disk files, this is trivial. However, many devices are really picky
  * about the conditions under which they will allow a write to occur.
- * Often devices restrict the conditions where writes can be made writes,
+ * Often devices restrict the conditions where writes can be made,
  * so it may not be feasable to append archives stored on all types of
  * devices.
  * Return:
@@ -351,7 +351,7 @@

    /*
     * Oh well, yet another failed read...
-    * if error limit reached, ditch. o.w. poke device to move past
+    * if error limit reached, ditch. otherwise poke device to move past
     * bad media and try again. if media is badly damaged, we ask
     * the poor (and upset user at this point) for the next archive
     * volume. remember the goal on reads is to get the most we
Index: cpio.c
===================================================================
RCS file: /cvsroot/src/bin/pax/cpio.c,v 
retrieving revision 1.13
diff -u -r1.13 cpio.c
--- cpio.c  2002/02/11 10:57:57 1.13
+++ cpio.c  2003/02/02 04:33:54
@@ -967,7 +967,7 @@ 
  * bcpio_wr()
  * copy the data in the ARCHD to buffer in old binary cpio format
  * There is a real chance of field overflow with this critter. So we 
- * always check the conversion is ok. nobody in his their right mind
+ * always check the conversion is ok. nobody in their right mind  
  * should write an archive in this format...
  * Return  
  * 0 if file has data to be written after the header, 1 if file has NO
Index: file_subs.c 
===================================================================
RCS file: /cvsroot/src/bin/pax/file_subs.c,v
retrieving revision 1.28
diff -u -r1.28 file_subs.c
--- file_subs.c 2003/01/06 20:30:28 1.28
+++ file_subs.c 2003/02/02 04:34:01
@@ -94,7 +94,7 @@
   * detect this, we use O_EXCL. For example when trying to create a
   * file and a character device or fifo exists with the same name, we
   * can accidently open the device by mistake (or block waiting to open)
-  * If we find that the open has failed, then figure spend the effort to
+  * If we find that the open has failed, then spend the effort to
   * figure out why. This strategy was found to have better average
   * performance in common use than checking the file (and the path)
   * first with lstat. 
Index: options.c  
===================================================================
RCS file: /cvsroot/src/bin/pax/options.c,v  
retrieving revision 1.58
diff -u -r1.58 options.c  
--- options.c 2003/01/09 17:26:21 1.58  
+++ options.c 2003/02/02 04:34:08  
@@ -168,7 +168,7 @@
   
 /*
  * ford is the archive search order used by get_arc() to determine what kind
- * of archive we are dealing with. This helps to properly id  archive formats
+ * of archive we are dealing with. This helps to properly id archive formats
  * some formats may be subsets of others....
  */ 
 int ford[] = {F_USTAR, F_TAR, F_SV4CRC, F_SV4CPIO, F_CPIO, F_BCPIO, -1};
Index: pat_rep.c 
===================================================================
RCS file: /cvsroot/src/bin/pax/pat_rep.c,v 
retrieving revision 1.17
diff -u -r1.17 pat_rep.c
--- pat_rep.c 2002/11/29 04:54:48 1.17 
+++ pat_rep.c 2003/02/02 04:34:12
@@ -190,7 +190,7 @@
  
  *pt2 = '\0';     

- /* Make sure to dup replacement, who know where it came from! */
+ /* Make sure to dup replacement, who knows where it came from! */
  if ((rep->nstr = strdup(pt1)) == NULL) {
 #ifdef NET2_REGEX
    (void)free((char *)rep->rcmp);
@@ -331,7 +331,7 @@
  *
  * NOTE: When the -c option is used, we are called when there was no match
  * by pat_match() (that means we did match before the inverted sense of
- * the logic). Now this seems really strange at first, but with -c  we
+ * the logic). Now this seems really strange at first, but with -c we
  * need to keep track of those patterns that cause a archive member to NOT
  * be selected (it found an archive member with a specified pattern)
  * Return:
@@ -422,7 +422,7 @@
   * we are then done with this pattern, so we delete it from the list
   * because it can never be used for another match.
   * Seems kind of strange to do for a -c, but the pax spec is really
-  * vague on the interaction of -c -n and -d. We assume that when -c
+  * vague on the interaction of -c, -n and -d. We assume that when -c
   * and the pattern rejects a member (i.e. it matched it) it is done.
   * In effect we place the order of the flags as having -c last.
   */
Index: sel_subs.c
===================================================================
RCS file: /cvsroot/src/bin/pax/sel_subs.c,v
retrieving revision 1.15
diff -u -r1.15 sel_subs.c
--- sel_subs.c  2002/01/31 19:27:54 1.15
+++ sel_subs.c  2003/02/02 04:34:22
@@ -384,7 +384,7 @@
  }

  /*
-  * by default we only will check file mtime, but usee can specify  
+  * by default we only will check file mtime, but user can specify 
   * mtime, ctime (inode change time) or both.
   */
  if ((flgpt == NULL) || (*flgpt == '\0'))
Index: tables.c
===================================================================
RCS file: /cvsroot/src/bin/pax/tables.c,v
retrieving revision 1.19
diff -u -r1.19 tables.c
--- tables.c  2003/01/06 20:30:29 1.19
+++ tables.c  2003/02/02 04:34:25
@@ -73,7 +73,7 @@ 
  * large archives. These database routines carefully combine memory usage and
  * temporary file storage in ways which will not significantly impact runtime
  * performance while allowing the largest possible archives to be handled.
- * Trying to force the fit to the posix databases routines was not considered
+ * Trying to force the fit to the posix database routines was not considered
  * time well spent.
  */

@@ -317,14 +317,14 @@
  * An append with an -u must read the archive and store the modification time
  * for every file on that archive before starting the write phase. It is clear
  * that this is one HUGE database. To save memory space, the actual file names
- * are stored in a scatch file and indexed by an in memory hash table. The
+ * are stored in a scratch file and indexed by an in-memory hash table. The
  * hash table is indexed by hashing the file path. The nodes in the table store
  * the length of the filename and the lseek offset within the scratch file
- * where the actual name is stored. Since there are never any deletions to this
+ * where the actual name is stored. Since there are never any deletions from this
  * table, fragmentation of the scratch file is never a issue. Lookups seem to
  * not exhibit any locality at all (files in the database are rarely
- * looked up more than once...). So caching is just a waste of memory. The
- * only limitation is the amount of scatch file space available to store the
+ * looked up more than once...), so caching is just a waste of memory. The
+ * only limitation is the amount of scratch file space available to store the
  * path names.
  */

@@ -890,7 +890,7 @@
  * directory access/mod time reset table routines (for directories READ by pax)
  *
  * The pax -t flag requires that access times of archive files to be the same
- * before being read by pax. For regular files, access time is restored after
+ * as before being read by pax. For regular files, access time is restored after
  * the file has been copied. This database provides the same functionality for
  * directories read during file tree traversal. Restoring directory access time
  * is more complex than files since directories may be read several times until
@@ -976,7 +976,7 @@
   * return (the older entry always has the correct time). The only
   * way this will happen is when the same subtree can be traversed by
   * different args to pax and the -n option is aborting fts out of a
-  * subtree before all the post-order visits have been made).
+  * subtree before all the post-order visits have been made.
   */
  indx = ((unsigned)ino) % A_TAB_SZ;
  if ((pt = atab[indx]) != NULL) {

>Release-Note:
>Audit-Trail:
>Unformatted: