]> andersk Git - moira.git/commitdiff
strip initial / from filenames in the generated tar file: our scripts
authordanw <danw>
Mon, 12 Jul 1999 16:27:56 +0000 (16:27 +0000)
committerdanw <danw>
Mon, 12 Jul 1999 16:27:56 +0000 (16:27 +0000)
always cd to / before untarring them, and so this makes it easier to
untar them into /var/tmp, etc to look at the data

gen/tar.c

index 867cbb278ad17c776771473342734b0160f9d28c..5fdf40a57cbd843bc150447f70ff426b57b7cd87 100644 (file)
--- a/gen/tar.c
+++ b/gen/tar.c
@@ -71,7 +71,7 @@ FILE *tarfile_start(TARFILE *tf, char *name, mode_t mode, uid_t uid, gid_t gid,
 {
   memset(&(tf->th), 0, sizeof(tf->th));
   memset(tf->th.chksum, ' ', sizeof(tf->th.chksum));
-  strcpy(tf->th.name, name);
+  strcpy(tf->th.name, (name[0] == '/' ? name + 1 : name));
   sprintf(tf->th.mode, "%07lo", (unsigned long)mode);
   sprintf(tf->th.uid, "%07lo", (unsigned long)uid);
   sprintf(tf->th.gid, "%07lo", (unsigned long)gid);
This page took 0.036596 seconds and 5 git commands to generate.