|
a/src/rcldb/rcldb.cpp |
|
b/src/rcldb/rcldb.cpp |
1 |
#ifndef lint
|
1 |
#ifndef lint
|
2 |
static char rcsid[] = "@(#$Id: rcldb.cpp,v 1.103 2007-01-19 10:23:26 dockes Exp $ (C) 2004 J.F.Dockes";
|
2 |
static char rcsid[] = "@(#$Id: rcldb.cpp,v 1.104 2007-01-25 15:47:23 dockes Exp $ (C) 2004 J.F.Dockes";
|
3 |
#endif
|
3 |
#endif
|
4 |
/*
|
4 |
/*
|
5 |
* This program is free software; you can redistribute it and/or modify
|
5 |
* This program is free software; you can redistribute it and/or modify
|
6 |
* it under the terms of the GNU General Public License as published by
|
6 |
* it under the terms of the GNU General Public License as published by
|
7 |
* the Free Software Foundation; either version 2 of the License, or
|
7 |
* the Free Software Foundation; either version 2 of the License, or
|
|
... |
|
... |
1417 |
}
|
1417 |
}
|
1418 |
} else {
|
1418 |
} else {
|
1419 |
regex_t reg;
|
1419 |
regex_t reg;
|
1420 |
int errcode;
|
1420 |
int errcode;
|
1421 |
if (typ == ET_REGEXP) {
|
1421 |
if (typ == ET_REGEXP) {
|
1422 |
// Compile regexp. We anchor the input by enclosing it in ^ and $
|
|
|
1423 |
string mroot = droot;
|
1422 |
string mroot = droot;
|
1424 |
if (mroot.at(0) != '^')
|
|
|
1425 |
mroot = string("^") + mroot;
|
|
|
1426 |
if (mroot.at(mroot.length()-1) != '$')
|
|
|
1427 |
mroot += "$";
|
|
|
1428 |
if ((errcode = regcomp(®, mroot.c_str(),
|
1423 |
if ((errcode = regcomp(®, mroot.c_str(),
|
1429 |
REG_EXTENDED|REG_NOSUB))) {
|
1424 |
REG_EXTENDED|REG_NOSUB))) {
|
1430 |
char errbuf[200];
|
1425 |
char errbuf[200];
|
1431 |
regerror(errcode, ®, errbuf, 199);
|
1426 |
regerror(errcode, ®, errbuf, 199);
|
1432 |
LOGERR(("termMatch: regcomp failed: %s\n", errbuf));
|
1427 |
LOGERR(("termMatch: regcomp failed: %s\n", errbuf));
|