Index: ossp-pkg/fsl/ChangeLog RCS File: /v/ossp/cvs/ossp-pkg/fsl/ChangeLog,v rcsdiff -q -kk '-r1.3' '-r1.4' -u '/v/ossp/cvs/ossp-pkg/fsl/ChangeLog,v' 2>/dev/null --- ChangeLog 2002/08/02 10:56:21 1.3 +++ ChangeLog 2002/08/02 11:00:23 1.4 @@ -11,6 +11,12 @@ Changes between 1.0.0 and 1.0.1 (01-Aug-2002 to xx-Aug-2002) + *) Remove pcre_study(3) usage, because we do no repeated matchings + and additionally (according to pcre(3)) studying for non-anchored + patterns that do not have a single fixed starting character is + useless. + [Ralf S. Engelschall ] + *) Compile regular expressions with PCRE_ANCHORED to make sure they are anchored. This means the ident "bar/.*" does not match "foobar/quux". If it should it now has to be written ".*bar/quux". Index: ossp-pkg/fsl/fsl.c RCS File: /v/ossp/cvs/ossp-pkg/fsl/fsl.c,v rcsdiff -q -kk '-r1.47' '-r1.48' -u '/v/ossp/cvs/ossp-pkg/fsl/fsl.c,v' 2>/dev/null --- fsl.c 2002/08/02 10:56:22 1.47 +++ fsl.c 2002/08/02 11:00:23 1.48 @@ -430,7 +430,6 @@ l2_result_t l2rv; int matchcount = 0; pcre *pcreRegex = NULL; - pcre_extra *pcreExtra = NULL; const char *cpError; int iError; int nMatch; @@ -528,11 +527,8 @@ /* compile regular expression into finite state machine and optimize */ if ((pcreRegex = pcre_compile(argmatch, PCRE_ANCHORED|PCRE_CASELESS, &cpError, &iError, NULL)) == NULL) { fsldebug(L2_LEVEL_ERROR, "processcfg: pcre_compile() failed with error %s (%d)", cpError, iError); CU(FSL_ERR_CUS); } - pcreExtra = pcre_study(pcreRegex, 0, &cpError); - if (cpError != NULL) { - fsldebug(L2_LEVEL_ERROR, "processcfg: pcre_study() failed with error %s", cpError); CU(FSL_ERR_CUS); } - nMatch = pcre_exec(pcreRegex, pcreExtra, cpISF, strlen(cpISF), 0, 0, ovec, OVECSIZE); + nMatch = pcre_exec(pcreRegex, NULL, cpISF, strlen(cpISF), 0, 0, ovec, OVECSIZE); if (nMatch < 0) fsldebug(L2_LEVEL_TRACE, "processcfg: matching ident/facility \"%s\" against section \"%s\" failed.", cpISF, argmatch); else @@ -561,10 +557,6 @@ matchcount++; free(argl2spec); } - if (pcreExtra != NULL) { - pcre_free(pcreExtra); - pcreExtra = NULL; - } if (pcreRegex != NULL) { pcre_free(pcreRegex); pcreRegex = NULL; @@ -612,10 +604,6 @@ else CU(FSL_OK); CUS: - if (pcreExtra != NULL) { - pcre_free(pcreExtra); - pcreExtra = NULL; - } if (pcreRegex != NULL) { pcre_free(pcreRegex); pcreRegex = NULL;