X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-regex.c;h=cac028b8c7a45baa6367c13a016ba46810cfa9bf;hb=1276a2c5f24c0c932426aca9c899fa524d2443f2;hp=5a94c14f0425a67e2f72f1ab8b3b9cf7ccb9b3ae;hpb=d69a4209386e256b60ece4407c16c272ff4e45ae;p=gnulib.git diff --git a/tests/test-regex.c b/tests/test-regex.c index 5a94c14f0..cac028b8c 100644 --- a/tests/test-regex.c +++ b/tests/test-regex.c @@ -1,5 +1,5 @@ /* Test regular expressions - Copyright 1996-2001, 2003-2013 Free Software Foundation, Inc. + Copyright 1996-2001, 2003-2014 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -79,17 +79,28 @@ main (void) */ static char const pat[] = "[^x]x"; static char const data[] = - "\xe1\x80\x80\xe1\x80\xbb\xe1\x80\xbd\xe1\x80\x94\xe1\x80" - "\xba\xe1\x80\xaf\xe1\x80\x95\xe1\x80\xbax"; + /* */ + "\xe1\x80\x80" + "\xe1\x80\xbb" + "\xe1\x80\xbd" + "\xe1\x80\x94" + "\xe1\x80\xba" + "\xe1\x80\xaf" + "\xe1\x80\x95" + "\xe1\x80\xba" + "x"; re_set_syntax (0); memset (®ex, 0, sizeof regex); s = re_compile_pattern (pat, sizeof pat - 1, ®ex); if (s) result |= 1; - else if (re_search (®ex, data, sizeof data - 1, - 0, sizeof data - 1, 0) - != 21) - result |= 1; + else + { + i = re_search (®ex, data, sizeof data - 1, + 0, sizeof data - 1, 0); + if (i != 0 && i != 21) + result |= 1; + } } if (! setlocale (LC_ALL, "C"))