From c3836e565b6e4bfe4470c0f4d9d1521939162407 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Wed, 3 Mar 2010 09:11:58 +0100 Subject: [PATCH] Display AllowCompress warning message only if compression used in FileSet --- bacula/src/dird/fd_cmds.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bacula/src/dird/fd_cmds.c b/bacula/src/dird/fd_cmds.c index f85b39f481..6b99d9992c 100644 --- a/bacula/src/dird/fd_cmds.c +++ b/bacula/src/dird/fd_cmds.c @@ -374,21 +374,24 @@ static bool send_fileset(JCR *jcr) /* Strip out compression option Zn if disallowed for this Storage */ if (store && !store->AllowCompress) { char newopts[MAX_FOPTS]; + bool done=false; /* print warning only if compression enabled in FS */ int j = 0; for (k=0; fo->opts[k]!='\0'; k++) { /* Z compress option is followed by the single-digit compress level */ if (fo->opts[k]=='Z') { + done=true; k++; /* skip option and level */ } else { newopts[j] = fo->opts[k]; - j++; + j++; } } newopts[j] = '\0'; - Jmsg(jcr, M_INFO, 0, - _("FD compression disabled for this Job because AllowCompress=No in Storage resource.\n") ); - + if (done) { + Jmsg(jcr, M_INFO, 0, + _("FD compression disabled for this Job because AllowCompress=No in Storage resource.\n") ); + } /* Send the new trimmed option set without overwriting fo->opts */ fd->fsend("O %s\n", newopts); } else { -- 2.39.5