[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

log --search test failures on trunk and 1.8.x

From: Ivan Zhakov <ivan_at_visualsvn.com>
Date: Tue, 16 Apr 2013 14:15:17 +0400

Hi,

I got following failures when running Debug build with VC 2010:
FAIL: log_tests.py 40: test 'svn log -g --search'
FAIL: log_tests.py 39: 'svn log --search'

They fail because of assertion in VC runtime:
[[[
W: f:\dd\vctools\crt_bld\self_x86\crt\src\isctype.c(68) : Assertion
failed: (unsigned)(c + 1) <= 256
]]]

This happens because apr_fnmatch does not handle UTF8 character and
pass UTF lead char to tolower() call. There is already XXX comment in
apr\strings\apr_fnmatch.c:121
[[
            /* Look at only well-formed range patterns;
             * "x-]" is not allowed unless escaped ("x-\]")
             * XXX: Fix for locale/MBCS character width
             */
            if (((*pattern)[1] == '-') && ((*pattern)[2] != ']'))
            {
                startch = *pattern;
                *pattern += (escape && ((*pattern)[2] == '\\')) ? 3 : 2;

                /* NOT a properly balanced [expr] pattern, EOS terminated
                 * or ranges containing a slash in FNM_PATHNAME mode pattern
                 * fall out to to the rewind and test '[' literal code path
                 */
                if (!**pattern || (slash && (**pattern == '/')))
                    break;

                /* XXX: handle locale/MBCS comparison, advance by MBCS
char width */
                if ((**string >= *startch) && (**string <= **pattern))
                    result = 0;
                else if (nocase && (isupper(**string) || isupper(*startch)
                                                      || isupper(**pattern))
                            && (tolower(**string) >= tolower(*startch))
                            && (tolower(**string) <= tolower(**pattern)))
                    result = 0;

                ++*pattern;
                continue;
            }

            /* XXX: handle locale/MBCS comparison, advance by MBCS char width */
            if ((**string == **pattern))
                result = 0;
            else if (nocase && (isupper(**string) || isupper(**pattern))
                            && (tolower(**string) == tolower(**pattern)))
                result = 0;
]]

Easy solution could be use apr_fnmatch without APR_FNM_CASE_BLIND and
make svn --search case-sensitive. Alternative solution is convert
search pattern and search string to lower case before passing to
apr_fnmatch. And third option is to fix apr_fnmatch().

-- 
Ivan Zhakov
CTO | VisualSVN | http://www.visualsvn.com

  • application/octet-stream attachment: fails.log
Received on 2013-04-16 12:16:12 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.