Преглед на файлове

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

Sergey Poznyakoff преди 18 години
родител
ревизия
6712656eb2
променени са 1 файла, в които са добавени 3 реда и са изтрити 2 реда
  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