From: Eric Bollengier Date: Wed, 3 Apr 2019 11:28:49 +0000 (+0200) Subject: Skip empty lines when generating the FileSet from a command X-Git-Tag: Release-9.4.3~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb6886a3cffb9aec3a230931460bf956bf3c9d95;p=thirdparty%2Fbacula.git Skip empty lines when generating the FileSet from a command --- diff --git a/bacula/src/filed/job.c b/bacula/src/filed/job.c index 8de8e3d6b..f69aa78af 100644 --- a/bacula/src/filed/job.c +++ b/bacula/src/filed/job.c @@ -1233,6 +1233,7 @@ void add_file_to_fileset(JCR *jcr, const char *fname, bool is_file) ch = (uint8_t)*p; switch (ch) { case '|': + Dmsg1(100, "Doing | of '%s' include on client.\n", p + 1); p++; /* skip over | */ fn = get_pool_memory(PM_FNAME); fn = edit_job_codes(jcr, fn, p, "", job_code_callback_filed); @@ -1247,7 +1248,9 @@ void add_file_to_fileset(JCR *jcr, const char *fname, bool is_file) free_pool_memory(fn); while (fgets(buf, sizeof(buf), bpipe->rfd)) { strip_trailing_junk(buf); - append_file(jcr, fileset->incexe, buf, is_file); + if (*buf) { /* Avoid empty lines */ + append_file(jcr, fileset->incexe, buf, is_file); + } } if ((stat=close_bpipe(bpipe)) != 0) { berrno be;