FERROR messages also need to leave leading newlines unmangled.
authorWayne Davison <wayned@samba.org>
Tue, 24 Jan 2006 01:07:19 +0000 (01:07 +0000)
committerWayne Davison <wayned@samba.org>
Tue, 24 Jan 2006 01:07:19 +0000 (01:07 +0000)
log.c

diff --git a/log.c b/log.c
index a1df72d..65952b5 100644 (file)
--- 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--;