+
+ if ( value.bv_val == NULL || value.bv_len == 0 ) {
+ rc = LDAP_INVALID_SYNTAX;
+ goto return_error;
+ }
+
+ switch ( tag ) {
+ case LDAP_SUBSTRING_INITIAL:
+ usage = SLAP_MR_SUBSTR_INITIAL;
+ break;
+
+ 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;
+
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "filter", LDAP_LEVEL_ERR,
+ "get_filter_substring: conn %d unknown substring choice=%ld\n",
+ conn->c_connid, (long)tag ));
+#else
+ Debug( LDAP_DEBUG_FILTER,
+ " unknown substring choice=%ld\n",
+ (long) tag, 0, 0 );
+#endif
+ goto return_error;
+ }
+
+ rc = value_normalize( f->f_sub_desc, usage, &value, &bv, text );
+
+ if( rc != LDAP_SUCCESS ) {
+ goto return_error;