[comp.bugs.4bsd] bug in tar's handling of absolute paths

sms@wlv.imsd.contel.com (Steven M. Schultz) (10/04/89)

Subject: bug in tar absolute pathname handling +FIX
Index:	bin/tar.c 2.10BSD

Description:
	Tar will not correctly handle absolute paths unless
	you start them from /

Repeat-By:
	cd /usr/src/sys
	tar c /usr

Fix:
	Apply the following patch.

-------------------------- CUT HERE -----------------------
*** tar.c.orig	Sat Apr 26 07:35:13 1986
--- tar.c	Tue Oct  3 15:27:47 1989
***************
*** 361,367 ****
  			argv++;
  			continue;
  		}
! 		parent = wdir;
  		for (cp = *argv; *cp; cp++)
  			if (*cp == '/')
  				cp2 = cp;
--- 361,373 ----
  			argv++;
  			continue;
  		}
! 
! 		if (*argv[0] == '/'){
! 			parent = "";
! 		} else {
! 			parent = wdir;
! 		}
! 
  		for (cp = *argv; *cp; cp++)
  			if (*cp == '/')
  				cp2 = cp;