Browse Source

Plan 9 from Bell Labs 2005-12-19

David du Colombier 15 years ago
parent
commit
aa1e17946f
4 changed files with 23 additions and 7 deletions
  1. 2 2
      dist/replica/_plan9.db
  2. 2 2
      dist/replica/plan9.db
  3. 2 0
      dist/replica/plan9.log
  4. 17 3
      sys/src/cmd/tar.c

+ 2 - 2
dist/replica/_plan9.db

@@ -413,7 +413,7 @@
 386/bin/swap - 775 sys sys 1132418765 62170
 386/bin/syscall - 775 sys sys 1130594788 73568
 386/bin/tail - 775 sys sys 1130594788 66201
-386/bin/tar - 775 sys sys 1131901139 97061
+386/bin/tar - 775 sys sys 1134928898 97221
 386/bin/tbl - 775 sys sys 1131302431 113308
 386/bin/tcs - 775 sys sys 1130384340 256598
 386/bin/tee - 775 sys sys 1130384340 38446
@@ -12951,7 +12951,7 @@ sys/src/cmd/tapefs/v10fs.c - 664 sys sys 1014926385 3754
 sys/src/cmd/tapefs/v6fs.c - 664 sys sys 1014926385 3971
 sys/src/cmd/tapefs/zip.h - 664 sys sys 1097914153 1428
 sys/src/cmd/tapefs/zipfs.c - 664 sys sys 1097900277 6803
-sys/src/cmd/tar.c - 664 sys sys 1131884442 21876
+sys/src/cmd/tar.c - 664 sys sys 1134907488 22101
 sys/src/cmd/tbl - 20000000775 sys sys 954038038 0
 sys/src/cmd/tbl/mkfile - 664 sys sys 944961243 268
 sys/src/cmd/tbl/t.h - 664 sys sys 944961244 3987

+ 2 - 2
dist/replica/plan9.db

@@ -413,7 +413,7 @@
 386/bin/swap - 775 sys sys 1132418765 62170
 386/bin/syscall - 775 sys sys 1130594788 73568
 386/bin/tail - 775 sys sys 1130594788 66201
-386/bin/tar - 775 sys sys 1131901139 97061
+386/bin/tar - 775 sys sys 1134928898 97221
 386/bin/tbl - 775 sys sys 1131302431 113308
 386/bin/tcs - 775 sys sys 1130384340 256598
 386/bin/tee - 775 sys sys 1130384340 38446
@@ -12951,7 +12951,7 @@ sys/src/cmd/tapefs/v10fs.c - 664 sys sys 1014926385 3754
 sys/src/cmd/tapefs/v6fs.c - 664 sys sys 1014926385 3971
 sys/src/cmd/tapefs/zip.h - 664 sys sys 1097914153 1428
 sys/src/cmd/tapefs/zipfs.c - 664 sys sys 1097900277 6803
-sys/src/cmd/tar.c - 664 sys sys 1131884442 21876
+sys/src/cmd/tar.c - 664 sys sys 1134907488 22101
 sys/src/cmd/tbl - 20000000775 sys sys 954038038 0
 sys/src/cmd/tbl/mkfile - 664 sys sys 944961243 268
 sys/src/cmd/tbl/t.h - 664 sys sys 944961244 3987

+ 2 - 0
dist/replica/plan9.log

@@ -23645,3 +23645,5 @@
 1134660686 5 c sys/src/libc/mkfile - 664 sys sys 1134659890 743
 1134671489 0 c 386/bin/du - 775 sys sys 1134669748 73748
 1134671489 1 c 386/bin/aux/msexceltables - 775 sys sys 1134669748 81264
+1134909030 0 c sys/src/cmd/tar.c - 664 sys sys 1134907488 22101
+1134930637 0 c 386/bin/tar - 775 sys sys 1134928898 97221

+ 17 - 3
sys/src/cmd/tar.c

@@ -634,10 +634,20 @@ addtoar(int ar, char *file, char *shortf)
 	ulong blksleft, blksread;
 	Hdr *hbp;
 	Dir *dir;
+	String *name = nil;
+
+	if (shortf[0] == '#') {
+		name = s_new();
+		s_append(name, "./");
+		s_append(name, shortf);
+		shortf = s_to_c(name);
+	}
 
 	fd = open(shortf, OREAD);
 	if (fd < 0) {
 		fprint(2, "%s: can't open %s: %r\n", argv0, file);
+		if (name)
+			s_free(name);
 		return;
 	}
 	dir = dirfstat(fd);
@@ -650,6 +660,8 @@ addtoar(int ar, char *file, char *shortf)
 		putbackblk(ar);
 		free(dir);
 		close(fd);
+		if (name)
+			s_free(name);
 		return;
 	}
 	putblk(ar);
@@ -679,6 +691,8 @@ addtoar(int ar, char *file, char *shortf)
 		if (verbose)
 			fprint(2, "%s\n", file);
 	}
+	if (name)
+		s_free(name);
 }
 
 static char *
@@ -783,7 +797,7 @@ cantcreate(char *s, int mode)
 {
 	int len;
 	static char *last;
-	
+
 	/*
 	 * Always print about files.  Only print about directories
 	 * we haven't printed about.  (Assumes archive is ordered
@@ -805,7 +819,7 @@ cantcreate(char *s, int mode)
 	}
 	fprint(2, "%s: can't create %s: %r\n", argv0, s);
 }
-	
+
 static int
 makedir(char *s)
 {
@@ -826,7 +840,7 @@ mkpdirs(char *s)
 {
 	int err;
 	char *p;
-	
+
 	p = s;
 	err = 0;
 	while (!err && (p = strchr(p+1, '/')) != nil) {