X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fcreate.c;h=a7d134495caba826d63b15dd5d82d8ee42183b87;hb=6600451136831cb42ddf08938dc9ead04e3ea723;hp=a701c5a0807918b00238f146f966907a24d76d74;hpb=d46735235be2b3bcaf2e580d86f321130cd78e94;p=chaz%2Ftar diff --git a/src/create.c b/src/create.c index a701c5a..a7d1344 100644 --- a/src/create.c +++ b/src/create.c @@ -327,7 +327,7 @@ Removing leading `/' from absolute path names in the archive"))); if (group_option != (gid_t) -1) st->st_gid = group_option; if (mode_option) - st->st_mode = ((st->st_mode & S_IFMT) + st->st_mode = ((st->st_mode & ~MODE_ALL) | mode_adjust (st->st_mode, mode_option)); /* Paul Eggert tried the trivial test ($WRITER cf a b; $READER tvf a) @@ -755,7 +755,8 @@ create_archive (void) collect_and_sort_names (); while (p = name_from_list (), p) - dump_file (p, (dev_t) -1, 1); + if (!excluded_pathname (excluded, p)) + dump_file (p, (dev_t) -1, 1); blank_name_list (); while (p = name_from_list (), p) @@ -780,7 +781,8 @@ create_archive (void) else { while (p = name_next (1), p) - dump_file (p, (dev_t) -1, 1); + if (!excluded_pathname (excluded, p)) + dump_file (p, (dev_t) -1, 1); } write_eot (); @@ -1478,9 +1480,10 @@ Read error at byte %s, reading %lu bytes, in file %s"), while (entry = readdir (directory), entry) { - /* Skip `.' and `..'. */ + /* Skip `.', `..', and excluded file names. */ - if (is_dot_or_dotdot (entry->d_name)) + if (is_dot_or_dotdot (entry->d_name) + || excluded_filename (excluded, entry->d_name)) continue; if ((int) NAMLEN (entry) + len >= buflen) @@ -1495,8 +1498,6 @@ Read error at byte %s, reading %lu bytes, in file %s"), #endif } strcpy (namebuf + len, entry->d_name); - if (exclude_option && check_exclude (namebuf)) - continue; dump_file (namebuf, our_device, 0); } @@ -1517,9 +1518,7 @@ Read error at byte %s, reading %lu bytes, in file %s"), type = BLKTYPE; #endif - /* Avoid screwy apollo lossage where S_IFIFO == S_IFSOCK. */ - -#if (_ISP__M68K == 0) && (_ISP__A88K == 0) && defined(S_ISFIFO) +#ifdef S_ISFIFO else if (S_ISFIFO (current_stat.st_mode)) type = FIFOTYPE; #endif @@ -1545,7 +1544,7 @@ Read error at byte %s, reading %lu bytes, in file %s"), header->header.typeflag = type; -#if defined(S_IFBLK) || defined(S_IFCHR) +#if defined S_ISBLK || defined S_ISCHR if (type != FIFOTYPE) { MAJOR_TO_OCT (major (current_stat.st_rdev), header->header.devmajor);