/*
Bacula® - The Network Backup Solution
- Copyright (C) 2006-2006 Free Software Foundation Europe e.V.
+ Copyright (C) 2006-2008 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
This program is Free Software; you can redistribute it and/or
modify it under the terms of version two of the GNU General Public
- License as published by the Free Software Foundation plus additions
- that are listed in the file LICENSE.
+ License as published by the Free Software Foundation and included
+ in the file LICENSE.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
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 Kern Sibbald.
The licensor of Bacula is the Free Software Foundation Europe
(FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
Switzerland, email:ftf@fsfeurope.org.
if (bufp->cflags & REG_ICASE) {
char *p, *lcase = bstrdup(regex);
for( p = lcase; *p ; p++) {
- *p = tolower(*p);
+ *p = tolower(*p);
}
re_compile_pattern(bufp, (unsigned char *)lcase);
bfree(lcase);
}
void re_registers_to_regmatch(regexp_registers_t old_regs,
- regmatch_t pmatch[],
- size_t nmatch)
+ regmatch_t pmatch[],
+ size_t nmatch)
{
size_t i=0;
int len = strlen(string);
struct re_registers regs;
stat = re_search(preg, (unsigned char *)string, len, 0, len, ®s);
- re_registers_to_regmatch(®s, pmatch, nmatch);
+ if (stat >= 0) {
+ re_registers_to_regmatch(®s, pmatch, nmatch);
+ }
/* stat is the start position in the string base 0 where
* the pattern was found or negative if not found.
*/
if (bufp->cflags & REG_ICASE) { /* we must use string in lowercase */
int len = strlen((const char *)str);
if (!bufp->lcase) {
- bufp->lcase = get_pool_memory(PM_FNAME);
+ bufp->lcase = get_pool_memory(PM_FNAME);
}
check_pool_memory_size(bufp->lcase, len+1);
unsigned char *dst = (unsigned char *)bufp->lcase;
while (*string) {
- *dst++ = tolower(*string++);
+ *dst++ = tolower(*string++);
}
*dst = '\0';
string = (unsigned char *)bufp->lcase;