X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=src%2Fpcrs.c;h=bb420a8f1a750a0bd67a75d9d8c918cd05705a66;hb=bdd466adf98c9d18e40cf5738b59f9f03412967d;hp=b6679f477b540dfd34a0ce266e9c15bdc26fdae1;hpb=4f16e82d36ed21582256aaab807fe57924f8b1e5;p=privoxy.git diff --git a/src/pcrs.c b/src/pcrs.c index b6679f47..bb420a8f 100644 --- a/src/pcrs.c +++ b/src/pcrs.c @@ -1,4 +1,4 @@ -const char pcrs_rcs[] = "$Id: pcrs.c,v 2.2 2002/09/04 15:52:02 oes Exp $"; +const char pcrs_rcs[] = "$Id: pcrs.c,v 2.4 2003/01/21 02:49:27 david__schmidt Exp $"; /********************************************************************* * @@ -33,6 +33,16 @@ const char pcrs_rcs[] = "$Id: pcrs.c,v 2.2 2002/09/04 15:52:02 oes Exp $"; * * Revisions : * $Log: pcrs.c,v $ + * Revision 2.4 2003/01/21 02:49:27 david__schmidt + * Developer TODO 612294: src: C++ keyword as variable name + * I changed all ocurrences of 'new' to 'new_something' wherever I found + * one. I also brought up all the source files in MSDEV to see if I could + * spot any highlighted keywords that really were variables. Non-scientific, + * but at least I tried. :-) + * + * Revision 2.3 2002/10/08 16:25:30 oes + * Bugfix: Need to check validity of backreferences explicitly, because when max_matches are reached and matches is expanded, realloc() does not zero the memory. Fixes Bug # 606227 + * * Revision 2.2 2002/09/04 15:52:02 oes * Synced with the stable branch: * Revision 1.19.2.1 2002/08/10 11:23:40 oes @@ -740,18 +750,18 @@ pcrs_job *pcrs_compile(const char *pattern, const char *substitute, const char * int pcrs_execute_list(pcrs_job *joblist, char *subject, size_t subject_length, char **result, size_t *result_length) { pcrs_job *job; - char *old, *new; + char *old_item, *new_item; int hits, total_hits; - old = subject; + old_item = subject; *result_length = subject_length; hits = total_hits = 0; for (job = joblist; job != NULL; job = job->next) { - hits = pcrs_execute(job, old, *result_length, &new, result_length); + hits = pcrs_execute(job, old_item, *result_length, &new_item, result_length); - if (old != subject) free(old); + if (old_item != subject) free(old_item); if (hits < 0) { @@ -760,11 +770,11 @@ int pcrs_execute_list(pcrs_job *joblist, char *subject, size_t subject_length, c else { total_hits += hits; - old = new; + old_item = new_item; } } - *result = new; + *result = new_item; return(total_hits); }