Fix pattern-matching of the top level path in a listing with search.
svn list -v PATH --search=PATTERN
The output for the top level PATH will now be included when a PATTERN matches the last component of its path-within-repository, or the empty string for the repository root path. This is consistent with matching all other paths in the listing.
Until now, and since the feature was introduced in r1767186, the top level path was reported only when a pattern matched the entire path-within-repository, starting with "/", of PATH's *parent* directory. For example, svn ls -v ^/subversion/trunk/README --search=PATTERN reported the top-level path only if PATTERN matched "/subversion/trunk".
Note that "-v" is specified in these examples because otherwise "svn" omits the top-level path when it is a directory.
* subversion/libsvn_client/list.c (list_internal): Match the basename, not the dirname, of the top level path.
Make the 'svn ls --search' implementation actually case- and accent- insensitive. The option handling of '--search' already assumes it but the implementation did not follow up.
That's easily done by using the same generic UTF8-based normalization to the path segments as 'svn' applies to the patterns. To reduce code duplication, move the normalization and matching function to lib_subr. And because there isn't really a better place to put it, add it to utf8proc.
* subversion/include/private/svn_utf_private.h (svn_utf__fuzzy_glob_match): Declare new private API.
* subversion/libsvn_subr/utf8proc.c (svn_utf__fuzzy_glob_match): Implement the function, code mostly taken from list.c.
* subversion/libsvn_client/list.c (match_patterns): Forward to the new matching function. (get_dir_contents): Add SCRATCH_BUFFER as a pass-through argument. (list_internal): Provide the SCRATCH_BUFFER.
* subversion/libsvn_repos/list.c (matches_any, do_list, svn_repos_list): Mirror the changes from the client side above.