+/*
+ * At present it simply eats the (optional) space after
+ * a RDN separator (,)
+ * Eventually will evolve in a more complete normalization
+ */
+static char *
+acl_regex_normalized_dn(
+ const char *pattern
+)
+{
+ char *str, *p;
+
+ str = ch_strdup( pattern );
+
+ if ( str == NULL ) {
+ return( NULL );
+ }
+
+ for ( p = str; p[ 0 ]; p++ ) {
+ /* escape */
+ if ( p[ 0 ] == '\\' ) {
+ p++;
+ }
+
+ if ( p[ 0 ] == ',' ) {
+ if ( p[ 1 ] == ' ' ) {
+ char *q;
+
+ for ( q = &p[ 2 ]; q[ 0 ] == ' '; q++ ) {
+ /* DO NOTHING */ ;
+ }
+ AC_MEMCPY( &p[ 1 ], &q[ 0 ], strlen( q ) + 1 );
+ }
+ }
+ }
+
+ return( str );
+}
+