Changed to conform to new pcrs interface
[privoxy.git] / loaders.c
index 7752a97..4fb6e9f 100644 (file)
--- a/loaders.c
+++ b/loaders.c
@@ -1,4 +1,4 @@
-const char loaders_rcs[] = "$Id: loaders.c,v 1.17 2001/06/29 13:31:51 oes Exp $";
+const char loaders_rcs[] = "$Id: loaders.c,v 1.20 2001/07/17 13:07:01 oes Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/loaders.c,v $
@@ -35,6 +35,16 @@ const char loaders_rcs[] = "$Id: loaders.c,v 1.17 2001/06/29 13:31:51 oes Exp $"
  *
  * Revisions   :
  *    $Log: loaders.c,v $
+ *    Revision 1.20  2001/07/17 13:07:01  oes
+ *    Fixed segv when last line in config files
+ *     lacked a terminating (\r)\n
+ *
+ *    Revision 1.19  2001/07/13 14:01:54  oes
+ *    Removed all #ifdef PCRS
+ *
+ *    Revision 1.18  2001/06/29 21:45:41  oes
+ *    Indentation, CRLF->LF, Tab-> Space
+ *
  *    Revision 1.17  2001/06/29 13:31:51  oes
  *    Various adaptions
  *
@@ -185,9 +195,8 @@ const char loaders_h_rcs[] = LOADERS_H_VERSION;
 static struct file_list *current_trustfile      = NULL;
 #endif /* def TRUST_FILES */
 
-#ifdef PCRS
 static struct file_list *current_re_filterfile  = NULL;
-#endif /* def PCRS */
+
 
 
 /*********************************************************************
@@ -243,12 +252,10 @@ void sweep(void)
             ncsp->actions_list->active = 1;
          }
 
-#ifdef PCRS
-         if (ncsp->rlist)     /* perl re files */
+         if (ncsp->rlist)     /* pcrsjob files */
          {
             ncsp->rlist->active = 1;
          }
-#endif /* def PCRS */
 
 #ifdef TRUST_FILES
          if (ncsp->tlist)     /* trust files */
@@ -605,6 +612,10 @@ char *read_config_line(char *buf, int buflen, FILE *fp, struct file_list *fs)
       {
          *p = '\0';
       }
+      else
+      {
+         p = linebuf + strlen(linebuf);
+      }
 
       /* Line continuation? Trim escape and set flag. */
       if ((p != linebuf) && (*--p == '\\'))
@@ -828,7 +839,6 @@ load_trustfile_error:
 #endif /* def TRUST_FILES */
 
 
-#ifdef PCRS
 /*********************************************************************
  *
  * Function    :  unload_re_filterfile
@@ -911,7 +921,7 @@ int load_re_filterfile(struct client_state *csp)
       enlist( bl->patterns, buf );
 
       /* We have a meaningful line -> make it a job */
-      if ((dummy = pcrs_compile(buf, &error)) == NULL)
+      if ((dummy = pcrs_compile_command(buf, &error)) == NULL)
       {
          log_error(LOG_LEVEL_RE_FILTER, 
                "Adding re_filter job %s failed with error %d.", buf, error);
@@ -957,7 +967,6 @@ load_re_filterfile_error:
    return(-1);
 
 }
-#endif /* def PCRS */
 
 
 /*********************************************************************