preface only relative names (such as "#foo") with "./". without this fix, tar was unable to create archives using absolute path names. Notes: Mon Dec 20 12:51:59 EST 2004 rsc don't think this is right -- makes it too hard to untar tars with absolute names into . the unix tar agrees with the old behavior. Reference: /n/sources/patch/applied/tar-abs-names Date: Tue Dec 21 06:31:59 CET 2004 Reviewed-by: rsc --- /sys/src/cmd/tar.c Tue Dec 21 06:32:00 2004 +++ /sys/src/cmd/tar.c Tue Dec 21 06:31:59 2004 @@ -455,8 +455,10 @@ fprint(2, "tar: %s: name too long (max %d)\n", sname, sizeof shortname - 3); return; } - - snprint(shortname, sizeof shortname, "./%s", sname); + if (sname[0] != '/') /* protect relative names like #foo */ + snprint(shortname, sizeof shortname, "./%s", sname); + else + strcpy(shortname, sname); infile = open(shortname, OREAD); if (infile < 0) { fprint(2, "tar: %s: cannot open file - %r\n", longname);