-#ifndef SLAPD_SCHEMA_NOT_COMPAT
- /* we should call a substring syntax normalization routine */
- value_normalize( val->bv_val, syntax );
- /* this is bogus, value_normalize should take a berval */
- val->bv_len = strlen( val->bv_val );
-#endif
+ case LDAP_SUBSTRING_ANY:
+ usage = SLAP_MR_SUBSTR_ANY;
+ break;
+
+ case LDAP_SUBSTRING_FINAL:
+ usage = SLAP_MR_SUBSTR_FINAL;
+ break;
+
+ default:
+ rc = LDAP_PROTOCOL_ERROR;
+
+ Debug( LDAP_DEBUG_FILTER,
+ " unknown substring choice=%ld\n",
+ (long) tag, 0, 0 );
+
+ ber_bvfree( value );
+ goto return_error;
+ }
+
+ rc = value_normalize( f->f_sub_desc, usage, value, &nvalue, text );
+ ber_bvfree( value );
+
+ if( rc != LDAP_SUCCESS ) {
+ goto return_error;
+ }
+
+ value = nvalue;
+
+ rc = LDAP_PROTOCOL_ERROR;