X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fcreate.c;h=1b08e0b21fd3e5f34675c01b8ad1f43b8477ca9c;hb=1209e0ebff2cdfbff2195a162d85df5de349bbaf;hp=e2f4ede6b8d12c1200c931f9f425c9537a72906b;hpb=93906c238d9309f95afeddfa9ac8d7ce92351e70;p=chaz%2Ftar diff --git a/src/create.c b/src/create.c index e2f4ede..1b08e0b 100644 --- a/src/create.c +++ b/src/create.c @@ -706,7 +706,7 @@ write_extended (bool global, struct tar_stat_info *st, union block *old_header) { type = XHDTYPE; p = xheader_xhdr_name (st); - t = st->stat.st_mtime; + t = set_mtime_option ? mtime_option.tv_sec : st->stat.st_mtime; } xheader_write (type, p, t, &st->xhdr); free (p); @@ -1472,8 +1472,8 @@ dump_hard_link (struct tar_stat_info *st) /* We found a link. */ char const *link_name = safer_name_suffix (duplicate->name, true, absolute_names_option); - - duplicate->nlink--; + if (duplicate->nlink) + duplicate->nlink--; block_ordinal = current_block_ordinal (); assign_string (&st->link_name, link_name);