Bump version for 3.0.1 pending release.
[privoxy.git] / pcrs.c
diff --git a/pcrs.c b/pcrs.c
index 45a471b..5780188 100644 (file)
--- a/pcrs.c
+++ b/pcrs.c
@@ -1,8 +1,8 @@
-const char pcrs_rcs[] = "$Id: pcrs.c,v 1.18 2002/03/08 14:17:14 oes Exp $";
+const char pcrs_rcs[] = "$Id: pcrs.c,v 1.19.2.1 2002/08/10 11:23:40 oes Exp $";
 
 /*********************************************************************
  *
- * File        :  $Source: /cvsroot/ijbswa/current/pcrs.c,v $
+ * File        :  $Source: /cvsroot/ijbswa/current/Attic/pcrs.c,v $
  *
  * Purpose     :  pcrs is a supplement to the pcre library by Philip Hazel
  *                <ph10@cam.ac.uk> and adds Perl-style substitution. That
@@ -33,6 +33,13 @@ const char pcrs_rcs[] = "$Id: pcrs.c,v 1.18 2002/03/08 14:17:14 oes Exp $";
  *
  * Revisions   :
  *    $Log: pcrs.c,v $
+ *    Revision 1.19.2.1  2002/08/10 11:23:40  oes
+ *    Include prce.h via project.h, where the appropriate
+ *    source will have been selected
+ *
+ *    Revision 1.19  2002/03/08 14:47:48  oes
+ *    Cosmetics
+ *
  *    Revision 1.18  2002/03/08 14:17:14  oes
  *    Fixing -Wconversion warnings
  *
@@ -126,7 +133,12 @@ const char pcrs_rcs[] = "$Id: pcrs.c,v 1.18 2002/03/08 14:17:14 oes Exp $";
  *********************************************************************/
 \f
 
-#include <pcre.h>
+/*
+ * Include project.h just so that the right pcre.h gets
+ * included from there
+ */
+#include "project.h"
+
 #include <string.h>
 #include <ctype.h>
 
@@ -907,7 +919,9 @@ int pcrs_execute(pcrs_job *job, char *subject, size_t subject_length, char **res
          if (k != job->substitute->backrefs
              /* ..in legal range.. */
              && job->substitute->backref[k] < PCRS_MAX_SUBMATCHES + 2
-             /* ..and referencing a nonempty match.. */
+              /* ..and referencing a real submatch.. */
+             && job->substitute->backref[k] < matches[i].submatches
+             /* ..that is nonempty.. */
              && matches[i].submatch_length[job->substitute->backref[k]] > 0)
          {
             /* ..copy the submatch that is ref'd. */