]> Dogcows Code - chaz/tar/commitdiff
(decode_header): Set uname/gname to NULL if their header counterparts are empty
authorSergey Poznyakoff <gray@gnu.org.ua>
Mon, 25 Oct 2004 15:56:57 +0000 (15:56 +0000)
committerSergey Poznyakoff <gray@gnu.org.ua>
Mon, 25 Oct 2004 15:56:57 +0000 (15:56 +0000)
src/list.c

index 0e5e205f9a4f43feb8a7fa052c4a7509c733335a..b592c8beb0ffe52cc736984d299ae77043ef1034 100644 (file)
@@ -532,8 +532,10 @@ decode_header (union block *header, struct tar_stat_info *stat_info,
 
   stat_info->stat.st_mode = MODE_FROM_HEADER (header->header.mode);
   stat_info->stat.st_mtime = TIME_FROM_HEADER (header->header.mtime);
-  assign_string (&stat_info->uname, header->header.uname);
-  assign_string (&stat_info->gname, header->header.gname);
+  assign_string (&stat_info->uname,
+                header->header.uname[0] ? header->header.uname : NULL);
+  assign_string (&stat_info->gname,
+                header->header.gname[0] ? header->header.gname : NULL);
   stat_info->devmajor = MAJOR_FROM_HEADER (header->header.devmajor);
   stat_info->devminor = MINOR_FROM_HEADER (header->header.devminor);
 
This page took 0.026911 seconds and 4 git commands to generate.