Return-Path: X-Original-To: apmail-apr-commits-archive@www.apache.org Delivered-To: apmail-apr-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B3CAA6752 for ; Wed, 18 May 2011 16:21:51 +0000 (UTC) Received: (qmail 3671 invoked by uid 500); 18 May 2011 16:21:51 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 3602 invoked by uid 500); 18 May 2011 16:21:51 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 3595 invoked by uid 99); 18 May 2011 16:21:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 May 2011 16:21:50 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 May 2011 16:21:48 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E583523888EA; Wed, 18 May 2011 16:21:27 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1124317 - /apr/apr/branches/1.5.x/strings/apr_fnmatch.c Date: Wed, 18 May 2011 16:21:27 -0000 To: commits@apr.apache.org From: wrowe@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110518162127.E583523888EA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: wrowe Date: Wed May 18 16:21:27 2011 New Revision: 1124317 URL: http://svn.apache.org/viewvc?rev=1124317&view=rev Log: Backport legibility enhancement from r1103115 (an illegible patch, in its own right, due to an svn:eol-style mess on svn cp). Modified: apr/apr/branches/1.5.x/strings/apr_fnmatch.c Modified: apr/apr/branches/1.5.x/strings/apr_fnmatch.c URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/strings/apr_fnmatch.c?rev=1124317&r1=1124316&r2=1124317&view=diff ============================================================================== --- apr/apr/branches/1.5.x/strings/apr_fnmatch.c (original) +++ apr/apr/branches/1.5.x/strings/apr_fnmatch.c Wed May 18 16:21:27 2011 @@ -118,8 +118,8 @@ static APR_INLINE int fnmatch_ch(const c leadingclosebrace: /* Look at only well-formed range patterns; * "x-]" is not allowed unless escaped ("x-\]") + * XXX: Fix for locale/MBCS character width */ - /* XXX: Fix for locale/MBCS character width */ if (((*pattern)[1] == '-') && ((*pattern)[2] != ']')) { startch = *pattern; @@ -370,12 +370,12 @@ APR_DECLARE(int) apr_fnmatch(const char } } - if (*string && (!slash || (*string != '/'))) + if (*string && !(slash && (*string == '/'))) return APR_FNM_NOMATCH; - if (*pattern && (!slash || ((*pattern != '/') - && (!escape || (*pattern != '\\') - || (pattern[1] != '/'))))) + if (*pattern && !(slash && ((*pattern == '/') + || (escape && (*pattern == '\\') + && (pattern[1] == '/'))))) return APR_FNM_NOMATCH; }