Changed package.c's write_dir not to write header for root dir

This commit is contained in:
rxi
2016-10-01 13:33:00 +01:00
parent cf39aee3cc
commit 626a778510

View File

@@ -107,12 +107,14 @@ static void write_dir(mtar_t *tar, const char *indir, const char *outdir) {
}
/* Write dir */
mtar_header_t h;
memset(&h, 0, sizeof(h));
concat(h.name, sizeof(h.name), outdir, NULL);
h.type = MTAR_TDIR;
h.mode = 0664;
mtar_write_header(tar, &h);
if (*outdir) {
mtar_header_t h;
memset(&h, 0, sizeof(h));
concat(h.name, sizeof(h.name), outdir, NULL);
h.type = MTAR_TDIR;
h.mode = 0664;
mtar_write_header(tar, &h);
}
/* Write files */
while ( (ep = readdir(dir)) ) {