summaryrefslogtreecommitdiff
path: root/log.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2006-01-24 01:07:19 +0000
committerWayne Davison <wayned@samba.org>2006-01-24 01:07:19 +0000
commit0ace7b2567944ae310d41c90ae7fc5a9273a77c7 (patch)
tree713efa44ed7c34be426c4eb90b52d6bff71022e1 /log.c
parentccb8f5788b6075414d0a529de2fa4cfe747b2624 (diff)
downloadrsync-0ace7b2567944ae310d41c90ae7fc5a9273a77c7.tar.gz
rsync-0ace7b2567944ae310d41c90ae7fc5a9273a77c7.tar.bz2
rsync-0ace7b2567944ae310d41c90ae7fc5a9273a77c7.zip
FERROR messages also need to leave leading newlines unmangled.
Diffstat (limited to 'log.c')
-rw-r--r--log.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/log.c b/log.c
index a1df72d0..65952b5c 100644
--- a/log.c
+++ b/log.c
@@ -265,10 +265,11 @@ void rwrite(enum logcode code, char *buf, int len)
case FERROR:
log_got_error = 1;
f = stderr;
- break;
+ goto pre_scan;
case FINFO:
f = am_server ? stderr : stdout;
- while (len && (*buf == '\n' || *buf == '\t')) {
+ pre_scan:
+ while (len > 1 && (*buf == '\n' || *buf == '\t')) {
fputc(*buf, f);
buf++;
len--;