Needed to make %G output "DEFAULT" when gid == GID_NONE.

This commit is contained in:
Wayne Davison
2006-02-04 18:40:41 +00:00
parent ee5544112a
commit 998113fedf

16
log.c
View File

@@ -453,10 +453,14 @@ static void log_formatted(enum logcode code, char *format, char *op,
n = buf2;
break;
case 'G':
strlcat(fmt, "d", sizeof fmt);
snprintf(buf2, sizeof buf2, fmt,
(long)file->gid);
n = buf2;
if (file->gid == GID_NONE)
n = "DEFAULT";
else {
strlcat(fmt, "ld", sizeof fmt);
snprintf(buf2, sizeof buf2, fmt,
(long)file->gid);
n = buf2;
}
break;
case 'p':
strlcat(fmt, "ld", sizeof fmt);
@@ -467,8 +471,8 @@ static void log_formatted(enum logcode code, char *format, char *op,
case 'M':
n = timestring(file->modtime);
{
char *cp;
while ((cp = strchr(n, ' ')) != NULL)
char *cp = n;
while ((cp = strchr(cp, ' ')) != NULL)
*cp = '-';
}
break;