Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-6]: src/bin/pax Pull up revision 1.21 (requested by lukem in ti...



details:   https://anonhg.NetBSD.org/src/rev/bc22052ffe22
branches:  netbsd-1-6
changeset: 528272:bc22052ffe22
user:      lukem <lukem%NetBSD.org@localhost>
date:      Fri Jun 28 13:01:16 2002 +0000

description:
Pull up revision 1.21 (requested by lukem in ticket #388):
Change how "cd .." is handled in next_file() with -M, to ensure that curdir[]
isn't addressed with a negative offset when back at the top of the tree.
This caused pax -M on sparc64 to generate corrupt tar files.
Problem found by Tim Goodwin <tjg%star.le.ac.uk@localhost> in [bin/17412].

diffstat:

 bin/pax/ftree.c |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (32 lines):

diff -r 28973e46c70b -r bc22052ffe22 bin/pax/ftree.c
--- a/bin/pax/ftree.c   Fri Jun 28 12:44:31 2002 +0000
+++ b/bin/pax/ftree.c   Fri Jun 28 13:01:16 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ftree.c,v 1.20 2002/04/20 23:36:48 lukem Exp $ */
+/*     $NetBSD: ftree.c,v 1.20.2.1 2002/06/28 13:01:16 lukem Exp $     */
 
 /*-
  * Copyright (c) 1992 Keith Muller.
@@ -78,7 +78,7 @@
 #if 0
 static char sccsid[] = "@(#)ftree.c    8.2 (Berkeley) 4/18/94";
 #else
-__RCSID("$NetBSD: ftree.c,v 1.20 2002/04/20 23:36:48 lukem Exp $");
+__RCSID("$NetBSD: ftree.c,v 1.20.2.1 2002/06/28 13:01:16 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -542,11 +542,10 @@
                                        set_ftime(ftent->fts_path,
                                            mtime, atime, 1);
                                }
+                               ftnode = ftnode->parent;
                                if (ftnode->parent == ftnode)
                                        ftnode = NULL;
-                               else
-                                       ftnode = ftnode->parent;
-                               if (ftnode != NULL) {
+                               else {
                                        curdirlen -= strlen(ftnode->name) + 1;
                                        curdir[curdirlen] = '\0';
                                }



Home | Main Index | Thread Index | Old Index