# Note:  Makefile is built automatically from Makefile.in
 #
-# $Id: GNUmakefile.in,v 1.55 2002/04/03 19:54:29 swa Exp $
+# $Id: GNUmakefile.in,v 1.56 2002/04/03 22:28:03 gliptak Exp $
 #
 # Written by and Copyright (C) 2001 the SourceForge
 # Privoxy team. http://www.privoxy.org/
 PCRE_OBJS    = @STATIC_PCRE_ONLY@$(PCRE_SRC:.c=.@OBJEXT@)
 PCRE_HDRS    = @STATIC_PCRE_ONLY@pcre/config.h pcre/chartables.c pcre/internal.h pcre/pcre.h
 
-# No REGEX (Either because dynamically linked pcreposix, or no regex at all):
+# No REGEX (maybe because dynamically linked pcreposix):
 REGEX_SRC    =
-# PCRE REGEX:
-@PCRE_REGEX_ONLY@@STATIC_PCRE_ONLY@REGEX_SRC = pcre/pcreposix.c
+@STATIC_PCRE_ONLY@REGEX_SRC = pcre/pcreposix.c
 
 REGEX_OBJS   = $(REGEX_SRC:.c=.@OBJEXT@)
 REGEX_HDRS   = $(REGEX_SRC:.c=.h)
 ## end:
 
 # $Log: GNUmakefile.in,v $
+# Revision 1.56  2002/04/03 22:28:03  gliptak
+# Removed references to gnu_regex
+#
 # Revision 1.55  2002/04/03 19:54:29  swa
 # freebsd tested to work. attempt to move tarball dist target forward
 #
 
  *
  * Revisions   :
  *    $Log: acconfig.h,v $
+ *    Revision 1.23  2002/04/03 22:28:03  gliptak
+ *    Removed references to gnu_regex
+ *
  *    Revision 1.22  2002/03/26 22:29:54  swa
  *    we have a new homepage!
  *
  */
 #undef CODE_STATUS
 
-/*
- * Regular expression matching for URLs.  (Highly recommended).
- * If neither of these are defined then you can ony use prefix matching.
- * Don't bother to change this here! Use configure instead.
- */
-#undef REGEX_PCRE
-
 /* 
  * Should pcre be statically built in instead of linkling with libpcre?
  * (This is determined by configure depending on the availiability of
 
-const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.24 2002/04/02 16:12:47 oes Exp $";
+const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.25 2002/04/03 22:28:03 gliptak Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/cgisimple.c,v $
  *
  * Revisions   :
  *    $Log: cgisimple.c,v $
+ *    Revision 1.25  2002/04/03 22:28:03  gliptak
+ *    Removed references to gnu_regex
+ *
  *    Revision 1.24  2002/04/02 16:12:47  oes
  *    Fix: moving misplaced lines into #ifdef FEATURE_FORCE
  *
    if (!err) err = map_conditional(exports, "FEATURE_TRUST", 0);
 #endif /* ndef FEATURE_TRUST */
 
-#ifdef REGEX_PCRE
-   if (!err) err = map_conditional(exports, "REGEX_PCRE", 1);
-#else /* ifndef REGEX_PCRE */
-   if (!err) err = map_conditional(exports, "REGEX_PCRE", 0);
-#endif /* def REGEX_PCRE */
-
 #ifdef STATIC_PCRE
    if (!err) err = map_conditional(exports, "STATIC_PCRE", 1);
 #else /* ifndef STATIC_PCRE */
 
  *
  * Revisions   :
  *    $Log: config.h.win,v $
+ *    Revision 1.20  2002/04/03 22:28:03  gliptak
+ *    Removed references to gnu_regex
+ *
  *    Revision 1.19  2002/03/26 22:29:54  swa
  *    we have a new homepage!
  *
  */
 #define CODE_STATUS "beta"
 
-/*
- * Regular expression matching for URLs.  (Highly recommended).
- * If neither of these are defined then you can ony use prefix matching.
- * Don't bother to change this here! Use configure instead.
- */
-#define REGEX_PCRE 1
-
 /* 
  * Should pcre be statically built in instead of linkling with libpcre?
  * (This is determined by configure depending on the availiability of
 
  *
  * Revisions   :
  *    $Log: config.h.win32threads.win,v $
+ *    Revision 1.14  2002/03/26 22:29:54  swa
+ *    we have a new homepage!
+ *
  *    Revision 1.13  2002/03/24 17:08:12  jongfoster
  *    Version number bump
  *
  */
 #define CODE_STATUS "beta"
 
-/*
- * Regular expression matching for URLs.  (Highly recommended).
- * If neither of these are defined then you can ony use prefix matching.
- * Don't bother to change this here! Use configure instead.
- */
-/* #define REGEX_GNU 1 */
-#define REGEX_PCRE 1
-
 /* 
  * Should pcre be statically built in instead of linkling with libpcre?
  * (This is determined by configure depending on the availiability of
 
 dnl Process this file with autoconf to produce a configure script.
 dnl 
-dnl $Id: configure.in,v 1.55 2002/04/03 03:54:38 gliptak Exp $
+dnl $Id: configure.in,v 1.56 2002/04/03 22:28:03 gliptak Exp $
 dnl 
 dnl Written by and Copyright (C) 2001, 2002 the SourceForge
 dnl Privoxy team. http://www.privoxy.org/
 dnl Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 dnl 
 dnl $Log: configure.in,v $
+dnl Revision 1.56  2002/04/03 22:28:03  gliptak
+dnl Removed references to gnu_regex
+dnl
 dnl Revision 1.55  2002/04/03 03:54:38  gliptak
 dnl Checking pcre version
 dnl
 dnl AutoConf Initialization
 dnl =================================================================
 
-AC_REVISION($Revision: 1.55 $)
+AC_REVISION($Revision: 1.56 $)
 AC_INIT(jcc.c)
 AC_CONFIG_HEADER([config.h])
 AC_CANONICAL_HOST
 dnl the choice is only between static and
 dnl dynamic:
 
-AC_ARG_ENABLE(regex-matching,
-[  --enable-regex-matching=pcre  Use perl-compatible regex for actionsfile
-                                pattern matching (default)
-  --disable-regex-matching      Don't use regex matching, compare URL
-                                prefix instead (won't shrink birary)],
-[ regex_matching=$enableval ],
-[ regex_matching=pcre ])
-
 AC_ARG_ENABLE(dynamic-pcre,
 [  --disable-dynamic-pcre        Use the built-in, static pcre, even if
                                 libpcre is available],
 [ if test $enableval = "no"; then have_pcrs=no; fi ])
 
 
-# Is the regex URL matching based on libpcreposix, but we
-# don't have that library?
-#
-if test $have_pcreposix = "yes" -o $regex_matching != "pcre"; then
-  dont_miss_pcreposix=yes
-else
-  dont_miss_pcreposix=no
-fi
-
 # If we have libpcre and either we also have pcreposix or
 # we don't need pcreposix, then link pcre dynamically; else
 # build it and link statically
 #
-if test $have_pcre = "yes" -a $dont_miss_pcreposix = "yes"; then
+if test $have_pcre = "yes"; then
   echo "using libpcre"
   pcre_dyn=yes
   STATIC_PCRE_ONLY=#
-  LIBS="$LIBS -lpcre"
+  LIBS="$LIBS -lpcre -lpcreposix"
 else
   echo "using built-in static pcre"
   pcre_dyn=no
   STATIC_PCRS_ONLY=
 fi
 
-# Which method should be used for URL matching?
-# pcre or prefix matching?
-#
-if test $regex_matching = "pcre"; then
-  echo "using pcre regex for URL matching"
-  AC_DEFINE(REGEX_PCRE)
-  PCRE_REGEX_ONLY=
-  if test $pcre_dyn = "yes"; then
-    LIBS="$LIBS -lpcreposix"
-  fi
-else
-  echo -e "using prefix matching for URLs\nHint: This does NOT make the executable any smaller!"
-  PCRE_REGEX_ONLY=#
-fi
-
-AC_SUBST(PCRE_REGEX_ONLY)
 AC_SUBST(STATIC_PCRE_ONLY)
 AC_SUBST(STATIC_PCRS_ONLY)
 
 
 #ifndef PROJECT_H_INCLUDED
 #define PROJECT_H_INCLUDED
-#define PROJECT_H_VERSION "$Id: project.h,v 1.63 2002/03/31 17:19:00 jongfoster Exp $"
+#define PROJECT_H_VERSION "$Id: project.h,v 1.64 2002/04/03 22:28:03 gliptak Exp $"
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/project.h,v $
  *
  * Revisions   :
  *    $Log: project.h,v $
+ *    Revision 1.64  2002/04/03 22:28:03  gliptak
+ *    Removed references to gnu_regex
+ *
  *    Revision 1.63  2002/03/31 17:19:00  jongfoster
  *    Win32 only: Enabling STRICT to fix a VC++ compile warning.
  *
  * and are included anyway.
  */
 
-#if defined(REGEX_PCRE)
-# define REGEX
-#endif /* defined(REGEX_PCRE) */
-
 #ifdef STATIC_PCRE
 #  include "pcre.h"
 #else
 #  include <pcrs.h>
 #endif
 
-#if defined(REGEX_PCRE)
-#  ifdef STATIC_PCRE
-#    include "pcreposix.h"
-#  else
-#    include <pcreposix.h>
-#  endif
-#endif /* defined(REGEX_PCRE) */
+#ifdef STATIC_PCRE
+#  include "pcreposix.h"
+#else
+#  include <pcreposix.h>
+#endif
 
 #ifdef AMIGA
 #include "amiga.h"
    char *path;         /* The path prefix (if not using regex), or source   */
                        /* for the regex.                                    */
    int   pathlen;      /* ==strlen(path).  Needed for prefix matching.      */
-#ifdef REGEX
    regex_t *preg;      /* Regex for matching path part                      */
-#endif
 };
-#ifdef REGEX
 #define URL_SPEC_INITIALIZER { NULL, NULL, NULL, 0, 0, 0, NULL, 0, NULL }
-#else /* ifndef REGEX */
-#define URL_SPEC_INITIALIZER { NULL, NULL, NULL, 0, 0, 0, NULL, 0 }
-#endif /* ndef REGEX */
 
 /* Constants for host part matching in URLs */
 #define ANCHOR_LEFT  1
 
-const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.7 2002/03/26 22:29:55 swa Exp $";
+const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.8 2002/04/03 23:32:47 jongfoster Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/urlmatch.c,v $
  *
  * Revisions   :
  *    $Log: urlmatch.c,v $
+ *    Revision 1.8  2002/04/03 23:32:47  jongfoster
+ *    Fixing memory leak on error
+ *
  *    Revision 1.7  2002/03/26 22:29:55  swa
  *    we have a new homepage!
  *
       url->path    = NULL;
       url->pathlen = 0;
    }
-#ifdef REGEX
    if (url->path)
    {
       int errcode;
          return JB_ERR_PARSE;
       }
    }
-#endif
    if ((p = strchr(buf, ':')) == NULL)
    {
       url->port = 0;
       {
          freez(url->spec);
          freez(url->path);
-#ifdef REGEX
          regfree(url->preg);
          freez(url->preg);
-#endif /* def REGEX */
          return JB_ERR_MEMORY;
       }
 
       {
          freez(url->spec);
          freez(url->path);
-#ifdef REGEX
          regfree(url->preg);
          freez(url->preg);
-#endif /* def REGEX */
          freez(url->dbuffer);
          url->dcount = 0;
          return JB_ERR_MEMORY;
          {
             freez(url->spec);
             freez(url->path);
-#ifdef REGEX
             regfree(url->preg);
             freez(url->preg);
-#endif /* def REGEX */
             freez(url->dbuffer);
             url->dcount = 0;
             return JB_ERR_MEMORY;
    freez(url->dbuffer);
    freez(url->dvec);
    freez(url->path);
-#ifdef REGEX
    if (url->preg)
    {
       regfree(url->preg);
       freez(url->preg);
    }
-#endif
-
 }
 
 
    return ((pattern->port == 0) || (pattern->port == url->port))
        && ((pattern->dbuffer == NULL) || (domain_match(pattern, url) == 0))
        && ((pattern->path == NULL) ||
-#ifdef REGEX
             (regexec(pattern->preg, url->path, 0, NULL, 0) == 0)
-#else
-            (strncmp(pattern->path, url->path, pattern->pathlen) == 0)
-#endif
       );
 }
 
 
-const char w32log_rcs[] = "$Id: w32log.c,v 1.23 2002/03/26 22:57:10 jongfoster Exp $";
+const char w32log_rcs[] = "$Id: w32log.c,v 1.24 2002/03/31 17:19:00 jongfoster Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/w32log.c,v $
  *
  * Revisions   :
  *    $Log: w32log.c,v $
+ *    Revision 1.24  2002/03/31 17:19:00  jongfoster
+ *    Win32 only: Enabling STRICT to fix a VC++ compile warning.
+ *
  *    Revision 1.23  2002/03/26 22:57:10  jongfoster
  *    Web server name should begin www.
  *
 
 /* FIXME: end kludge */
 
-
-#ifdef REGEX
 /* Regular expression for detected URLs */
 #define RE_URL "http:[^ \n\r]*"
 
    /* this is the terminator statement - do not delete! */
    { NULL,                  STYLE_NONE }
 };
-#endif /* def REGEX */
-
 
 /*
  * Public variables
  *********************************************************************/
 void LogCreatePatternMatchingBuffers(void)
 {
-#ifdef REGEX
    int i;
    for (i = 0; patterns_to_highlight[i].str != NULL; i++)
    {
       regcomp(&patterns_to_highlight[i].buffer, patterns_to_highlight[i].str, REG_ICASE);
    }
-#endif
-
 }
 
 
  *********************************************************************/
 void LogDestroyPatternMatchingBuffers(void)
 {
-#ifdef REGEX
    int i;
    for (i = 0; patterns_to_highlight[i].str != NULL; i++)
    {
       regfree(&patterns_to_highlight[i].buffer);
    }
-#endif
-
 }
 
 
 char *LogGetURLUnderCursor(void)
 {
    char *szResult = NULL;
-#ifdef REGEX
    regex_t re;
    POINT ptCursor;
    POINTL ptl;
 
       regfree(&re);
    }
-#endif
    return szResult;
 
 }
  * Function    :  LogPutString
  *
  * Description :  Inserts text into the logging window.  This is really
- *                a REGEXP aware wrapper function to `LogPutStringNoMatch'.
+ *                a regexp aware wrapper function to `LogPutStringNoMatch'.
  *
  * Parameters  :
  *          1  :  pszText = pointer to string going to the log window
  *********************************************************************/
 int LogPutString(const char *pszText)
 {
-#ifdef REGEX
    int i;
-#endif
    int result = 0;
 
    if (pszText == NULL || strlen(pszText) == 0)
     */
    EnterCriticalSection(&g_criticalsection);
 
-#ifdef REGEX
    if (g_bHighlightMessages)
    {
       regmatch_t match;
          }
       }
    }
-#endif
 
    result = LogPutStringNoMatch(pszText, STYLE_NONE);
 
-#ifdef REGEX
 end:
-#endif
    LeaveCriticalSection(&g_criticalsection);
 
    return result;