From: Eric Bollengier Date: Fri, 18 Jun 2010 07:02:34 +0000 (+0200) Subject: Fix accurate code X-Git-Tag: Release-5.0.3~157 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5ae2f5f58dcc9c0ce0818184b17f9e79a2ab17be;p=bacula%2Fbacula Fix accurate code --- diff --git a/bacula/src/cats/cats.h b/bacula/src/cats/cats.h index 674d57bb33..065eb06434 100644 --- a/bacula/src/cats/cats.h +++ b/bacula/src/cats/cats.h @@ -1165,9 +1165,18 @@ public: POOLMEM *list; /* list */ int count; /* number of values seen */ - db_list_ctx() { list = get_pool_memory(PM_FNAME); *list = 0; count = 0; } + db_list_ctx() { list = get_pool_memory(PM_FNAME); reset(); } ~db_list_ctx() { free_pool_memory(list); list = NULL; } - + void reset() { *list = 0; count = 0;} + void cat(const db_list_ctx &str) { + if (str.count > 0) { + if (*list) { + pm_strcat(list, ","); + } + pm_strcat(list, str.list); + count += str.count; + } + } private: db_list_ctx(const db_list_ctx&); /* prohibit pass by value */ db_list_ctx &operator=(const db_list_ctx&); /* prohibit class assignment */ diff --git a/bacula/src/cats/sql_get.c b/bacula/src/cats/sql_get.c index aee3d5d1f3..9f084a2c45 100644 --- a/bacula/src/cats/sql_get.c +++ b/bacula/src/cats/sql_get.c @@ -1159,6 +1159,7 @@ bool db_accurate_get_jobids(JCR *jcr, B_DB *mdb, utime_t StartTime = (jr->StartTime)?jr->StartTime:time(NULL); bstrutime(date, sizeof(date), StartTime + 1); + jobids->reset(); /* First, find the last good Full backup for this job/client/fileset */ Mmsg(query,