From 0fd49f51a052c54a86f9dcc12d9820c897262fa8 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Thu, 3 Mar 2005 23:13:04 +0000 Subject: [PATCH] (print_header): Print UID/GID in case of empty user/group name. This could occur when dumping files belonging to non-existing users and when listing broken archives. Reported by Igor Lautar. --- src/list.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/list.c b/src/list.c index baee9e8..0657fcf 100644 --- a/src/list.c +++ b/src/list.c @@ -1098,7 +1098,9 @@ print_header (struct tar_stat_info *st, off_t block_ordinal) /* User and group names. */ - if (st->uname && current_format != V7_FORMAT + if (st->uname + && st->uname[0] + && current_format != V7_FORMAT && !numeric_owner_option) user = st->uname; else @@ -1121,7 +1123,9 @@ print_header (struct tar_stat_info *st, off_t block_ordinal) } } - if (st->gname && current_format != V7_FORMAT + if (st->gname + && st->gname[0] + && current_format != V7_FORMAT && !numeric_owner_option) group = st->gname; else -- 2.45.2