Przeglądaj źródła

(mtime_coder): Treat non-null data as a pointer to struct timespec, overriding st->mtime

Sergey Poznyakoff 18 lat temu
rodzic
commit
6712656eb2
1 zmienionych plików z 3 dodań i 2 usunięć
  1. 3 2
      src/xheader.c

+ 3 - 2
src/xheader.c

@@ -1094,9 +1094,10 @@ ctime_decoder (struct tar_stat_info *st,
 
 static void
 mtime_coder (struct tar_stat_info const *st, char const *keyword,
-	     struct xheader *xhdr, void const *data __attribute__ ((unused)))
+	     struct xheader *xhdr, void const *data)
 {
-  code_time (st->mtime, keyword, xhdr);
+  const struct timespec mtime = data ? *(struct timespec *) data : st->mtime;
+  code_time (mtime, keyword, xhdr);
 }
 
 static void