]> Dogcows Code - chaz/tar/blobdiff - src/create.c
Fix tar -c -l file file
[chaz/tar] / src / create.c
index e2f4ede6b8d12c1200c931f9f425c9537a72906b..1b08e0b21fd3e5f34675c01b8ad1f43b8477ca9c 100644 (file)
@@ -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);
This page took 0.021163 seconds and 4 git commands to generate.