From c19938dbf9e2533faf61c41aa03341dbfa8099ce Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Tue, 10 Apr 2007 15:22:56 +0000 Subject: [PATCH] ebl fix compilation git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4531 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/patches/testing/breg.c | 15 ++++++++------- bacula/patches/testing/bregtest.c | 13 ++++++++----- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/bacula/patches/testing/breg.c b/bacula/patches/testing/breg.c index 9d53f1a7fe..7468c6572d 100644 --- a/bacula/patches/testing/breg.c +++ b/bacula/patches/testing/breg.c @@ -7,7 +7,7 @@ * */ /* - Bacula® - The Network Backup Solution + BaculaÂ® - The Network Backup Solution Copyright (C) 2006-2006 Free Software Foundation Europe e.V. @@ -28,9 +28,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - Bacula® is a registered trademark of John Walker. + BaculaÂ® is a registered trademark of John Walker. The licensor of Bacula is the Free Software Foundation Europe - (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich, + (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 ZÃ¼rich, Switzerland, email:ftf@fsfeurope.org. */ @@ -383,10 +383,11 @@ int bregexp_get_build_where_size(char *strip_prefix, * add_prefix = !^!add_prefix! 5 bytes * add_suffix = !([^/])$!$1add_suffix! 13 bytes */ - int str_size = (strip_prefix?strlen(strip_prefix)+4:0 + - add_prefix?strlen(add_prefix)+5:0 + /* escape + 3*, + \0 */ - add_suffix?strlen(add_suffix)+14:0 ) * 2 + 3 + 1; + int str_size = ((strip_prefix?strlen(strip_prefix)+4:0) + + (add_prefix?strlen(add_prefix)+5 :0) + /* escape + 3*, + \0 */ + (add_suffix?strlen(add_suffix)+14 :0) ) * 2 + 3 + 1; + Dmsg1(1, "bregexp_get_build_where_size = %i\n", str_size); return str_size; } @@ -432,7 +433,7 @@ char *bregexp_build_where(char *dest, int str_size, free_pool_memory(str_tmp); - return ret; + return dest; } diff --git a/bacula/patches/testing/bregtest.c b/bacula/patches/testing/bregtest.c index 07104544c3..52073ea00f 100644 --- a/bacula/patches/testing/bregtest.c +++ b/bacula/patches/testing/bregtest.c @@ -5,7 +5,7 @@ * */ /* - Bacula® - The Network Backup Solution + BaculaÂ® - The Network Backup Solution Copyright (C) 2006-2006 Free Software Foundation Europe e.V. @@ -26,9 +26,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - Bacula® is a registered trademark of John Walker. + BaculaÂ® is a registered trademark of John Walker. The licensor of Bacula is the Free Software Foundation Europe - (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich, + (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 ZÃ¼rich, Switzerland, email:ftf@fsfeurope.org. */ @@ -62,8 +62,11 @@ static void usage() int main(int argc, char *const *argv) { - printf("%s\n", bregexp_build_where("/tmp", NULL, ".old")); - exit(0); + char tab[500]; + int len = bregexp_get_build_where_size("/tmp", "/tmp/toto", ".old"); + + printf("%s\n", bregexp_build_where(tab, len, "/tmp", "/tmp/toto!", ".old")); + exit(0); regex_t preg; -- 2.39.2