Path: utzoo!mnetor!uunet!munnari!vuwcomp!csvaxa!edward From: edward@csvaxa.UUCP (Edward Wilkinson) Newsgroups: comp.unix.wizards Subject: Re: Tar and absolute pathnames Message-ID: <189@csvaxa.UUCP> Date: 8 Mar 88 00:31:16 GMT References: <3990@hoptoad.uucp> <570001@hpsemc.HP.COM> Reply-To: E.Wilkinson@massey.ac.nz Organization: Computer Centre, Massey University, Palmerston North, New Zealand Lines: 118 Keywords: tar, PD tar, absolute pathnames Summary: patch for Gnu tar (from gnu@hoptoad) I, too, have had this problem. So I wrote a small fix to the PD tar floating around. Not very fancy, but it seems to work: ----------cut-here-------------cut-here-------------cut-here---------- *** tar.c Thu Mar 3 15:50:30 1988 --- tar.c~ Mon Oct 26 18:33:19 1987 *************** *** 102,108 ar_file = DEF_AR_FILE; /* From Makefile */ /* Parse options */ ! while ((c = getoldopt(argc, argv, "b:BcdDf:ahikmopstT:vxzZ") ) != EOF) { switch (c) { --- 102,108 ----- ar_file = DEF_AR_FILE; /* From Makefile */ /* Parse options */ ! while ((c = getoldopt(argc, argv, "b:BcdDf:hikmopstT:vxzZ") ) != EOF) { switch (c) { *************** *** 179,188 f_namefile++; break; - case 'a': - f_crunch_slash++; - break; - case 'v': f_verbose++; break; --- 179,184 ----- f_namefile++; break; case 'v': f_verbose++; break; *************** *** 215,221 { fputs("tar: valid options:\n\ - -a remove any leading / from absolute pathnames when extracting\n\ -b N blocking factor N (block size = Nx512 bytes)\n\ -B reblock as we read (for reading 4.2BSD pipes)\n\ -c create an archive\n\ --- 211,216 ----- { fputs("tar: valid options:\n\ -b N blocking factor N (block size = Nx512 bytes)\n\ -B reblock as we read (for reading 4.2BSD pipes)\n\ -c create an archive\n\ *** tar.h Thu Mar 3 14:56:04 1988 --- tar.h~ Mon Oct 26 18:33:22 1987 *************** *** 109,115 TAR_EXTERN char f_verbose; /* -v */ TAR_EXTERN char f_extract; /* -x */ TAR_EXTERN char f_compress; /* -z */ - TAR_EXTERN char f_crunch_slash; /* -a */ /* * We now default to Unix Standard format rather than 4.2BSD tar format. --- 109,114 ----- TAR_EXTERN char f_verbose; /* -v */ TAR_EXTERN char f_extract; /* -x */ TAR_EXTERN char f_compress; /* -z */ /* * We now default to Unix Standard format rather than 4.2BSD tar format. *** extract.c Thu Mar 3 15:38:37 1988 --- extract.c~ Mon Oct 26 18:33:19 1987 *************** *** 106,120 if (f_verbose) print_header(stdout); - /* if -a then crunch initial / on pathname */ - if (f_crunch_slash) - if (head->header.name[0] == '/') { - char tmp[4096]; - - strcpy(tmp, head->header.name + 1); - strcpy(head->header.name, tmp); - } - switch (head->header.linkflag) { default: --- 106,111 ----- if (f_verbose) print_header(stdout); switch (head->header.linkflag) { d