summaryrefslogtreecommitdiff
path: root/log.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2006-02-04 18:40:41 +0000
committerWayne Davison <wayned@samba.org>2006-02-04 18:40:41 +0000
commit998113fedf200f94ee3e361deed00a9bd6e7d2a7 (patch)
tree9532bdde49a753b8196e1b7ce01bb3e430ea73af /log.c
parentee5544112a2ac420d7e8737f275a8f268071f351 (diff)
downloadrsync-998113fedf200f94ee3e361deed00a9bd6e7d2a7.tar.gz
rsync-998113fedf200f94ee3e361deed00a9bd6e7d2a7.tar.bz2
rsync-998113fedf200f94ee3e361deed00a9bd6e7d2a7.zip
Needed to make %G output "DEFAULT" when gid == GID_NONE.
Diffstat (limited to 'log.c')
-rw-r--r--log.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/log.c b/log.c
index dad939b1..bc8c747a 100644
--- a/log.c
+++ b/log.c
@@ -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;