From cfdccc079c17d63c07984e8453cabff8753e858c Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Tue, 27 Oct 2015 12:29:22 +0100 Subject: [PATCH] ITS#8292 Fix ldif-filter, drop workaround for bug --- tests/progs/ldif-filter.c | 16 +++++++++++----- tests/scripts/test063-delta-multimaster | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/progs/ldif-filter.c b/tests/progs/ldif-filter.c index cf9d257394..9425979d5f 100644 --- a/tests/progs/ldif-filter.c +++ b/tests/progs/ldif-filter.c @@ -59,15 +59,21 @@ get_flags( const char *backend, const char *spec ) { size_t len = strlen( backend ); unsigned flags = DUMMY_FLAG; - const char *tmp; + const char *end, *tmp; - while ( '=' != *(spec += strncmp( spec, backend, len ) ? 0 : len) ) { - if ( (spec = strchr( spec, ',' )) == NULL ) { + for ( ;; spec = end + ( *end != '\0' )) { + if ( !*spec ) return 0; + end = spec + strcspn( spec, "," ); + if ( !(tmp = memchr( spec, '=', end-spec ))) + break; + if ( tmp-spec == len && !memcmp( spec, backend, len )) { + spec = tmp+1; + break; } - ++spec; } - while ( *++spec && *spec != ',' ) { + + for ( ; spec < end; spec++ ) { if ( (tmp = strchr( spec_options, *spec )) == NULL ) { usage(); } diff --git a/tests/scripts/test063-delta-multimaster b/tests/scripts/test063-delta-multimaster index 3b7e14716f..a8d7257042 100755 --- a/tests/scripts/test063-delta-multimaster +++ b/tests/scripts/test063-delta-multimaster @@ -520,7 +520,7 @@ if test $RC != 0 ; then test $KILLSERVERS != no && kill -HUP $KILLPIDS exit $RC fi -$LDIFFILTER -s $BACKEND=a < $TESTDIR/server$n.out > $TESTDIR/server$n.flt +$LDIFFILTER -s a < $TESTDIR/server$n.out > $TESTDIR/server$n.flt n=`expr $n + 1` done -- 2.39.5