From: Sergey Poznyakoff Date: Mon, 25 Oct 2004 15:56:57 +0000 (+0000) Subject: (decode_header): Set uname/gname to NULL if their header counterparts are empty X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=b55daca933dbc003842252e77593545d27142926;p=chaz%2Ftar (decode_header): Set uname/gname to NULL if their header counterparts are empty --- diff --git a/src/list.c b/src/list.c index 0e5e205..b592c8b 100644 --- a/src/list.c +++ b/src/list.c @@ -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);