]> git.sur5r.net Git - openldap/blobdiff - libraries/librewrite/subst.c
don't keep searching referrals...
[openldap] / libraries / librewrite / subst.c
index fe055a35ccae4afb35cfc1a9e54151d3e7c51e2e..6a7feda3e42489da1a2fc3398bb333309fb52249 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2000-2003 The OpenLDAP Foundation.
+ * Copyright 2000-2006 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -55,11 +55,11 @@ rewrite_subst_compile(
                /*
                 * Keep only single escapes '%'
                 */
-               if ( p[ 0 ] != REWRITE_SUBMATCH_ESCAPE ) {
+               if (  !IS_REWRITE_SUBMATCH_ESCAPE( p[ 0 ] ) ) {
                        continue;
                } 
 
-               if ( p[ 1 ] == REWRITE_SUBMATCH_ESCAPE ) {
+               if (  IS_REWRITE_SUBMATCH_ESCAPE( p[ 1 ] ) ) {
                        /* Pull &p[1] over p, including the trailing '\0' */
                        AC_MEMCPY((char *)p, &p[ 1 ], strlen( p ) );
                        continue;
@@ -387,6 +387,7 @@ rewrite_subst_apply(
 
                if ( rc != REWRITE_SUCCESS ) {
                        rc = REWRITE_REGEXEC_ERR;
+                       goto cleanup;
                }
                
                /*
@@ -452,8 +453,8 @@ rewrite_subst_destroy(
        int                     n;
        struct rewrite_subst    *subst;
 
-       assert( psubst );
-       assert( *psubst );
+       assert( psubst != NULL );
+       assert( *psubst != NULL );
 
        subst = *psubst;