From: Michihiro NAKAJIMA Date: Wed, 10 Oct 2012 01:11:44 +0000 (+0900) Subject: Fix matching test name to correctly check a test name terminator. X-Git-Tag: v3.1.0~40^2~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2576a7428397690d890e7a7a010ba2db8fc6906;p=thirdparty%2Flibarchive.git Fix matching test name to correctly check a test name terminator. --- diff --git a/test_utils/test_utils.c b/test_utils/test_utils.c index 48ab6fbdd..8ea3d3c4b 100644 --- a/test_utils/test_utils.c +++ b/test_utils/test_utils.c @@ -57,13 +57,12 @@ test_filter(const char *pattern, const char *test) p++; if (p[0] == '\\') p++; - while (p[0] != t[0]) - t++; + if ((t = strchr(t, p[0])) == 0) + break; } if (p[0] != t[0]) break; - if (p[0] == '\0' && t[0] == '\0') - { + if (p[0] == '\0') { retval = 1; break; }