From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31802 invoked by alias); 18 Nov 2015 05:52:56 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 31790 invoked by uid 89); 18 Nov 2015 05:52:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-io0-f182.google.com Received: from mail-io0-f182.google.com (HELO mail-io0-f182.google.com) (209.85.223.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 18 Nov 2015 05:52:53 +0000 Received: by iofh3 with SMTP id h3so43189286iof.3 for ; Tue, 17 Nov 2015 21:52:52 -0800 (PST) X-Received: by 10.107.148.8 with SMTP id w8mr1282935iod.3.1447825971972; Tue, 17 Nov 2015 21:52:51 -0800 (PST) Received: from [192.168.43.25] ([166.175.190.93]) by smtp.gmail.com with ESMTPSA id u12sm9489806igr.22.2015.11.17.21.52.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Nov 2015 21:52:51 -0800 (PST) To: cygwin@cygwin.com From: Dustin Boyd Subject: fnmatch() doesn't work with character classes? Message-ID: <564C122C.7080608@gmail.com> Date: Wed, 18 Nov 2015 05:52:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------070300020907010102090601" X-SW-Source: 2015-11/txt/msg00246.txt.bz2 --------------070300020907010102090601 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-length: 651 fnmatch() does not appear to work with character classes or character equivalents. regcomp(), however, does work with character classes, but not character equivalents. Is this behavior one should expect? I've tested with Debian, and it matches in both cases. I sent this to the Cygwin ML rather than the Newlib ML just because of the fact that it may be locale-related, which is a problem on Cygwin's end, not Newlib's, if it's a problem at all. The attached program will hopefully illustrate the trouble occurring on my Windows 10 machine: regexec: 0 matched /[[:digit:]]/ fnmatch: 0 did not match /[[:digit:]]/ -- Sent using Mozilla Thunderbird --------------070300020907010102090601 Content-Type: text/plain; charset=UTF-8; name="fnmatch_fail.c" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="fnmatch_fail.c" Content-length: 936 I2RlZmluZSBfWE9QRU5fU09VUkNFIDcwMAojaW5jbHVkZSA8YXNzZXJ0Lmg+ CiNpbmNsdWRlIDxmbm1hdGNoLmg+CiNpbmNsdWRlIDxyZWdleC5oPgojaW5j bHVkZSA8c3RkaW8uaD4KCmludAptYWluICh2b2lkKQp7CiAgcmVnZXhfdCBy ZWc7CiAgY29uc3QgY2hhciAqcGF0dGVybiA9ICJbWzpkaWdpdDpdXSI7CiAg Y29uc3QgY2hhciAqcyA9ICIwIjsKICBpbnQgY2ZsYWdzID0gUkVHX05PU1VC OwoKICBhc3NlcnQocmVnY29tcCgmcmVnLCBwYXR0ZXJuLCBjZmxhZ3MpID09 IDApOwogIGlmIChyZWdleGVjKCZyZWcsIHMsIDAsIE5VTEwsIDApID09IFJF R19OT01BVENIKQogICAgewogICAgICBwcmludGYoInJlZ2V4ZWM6ICVzIGRp ZCBub3QgbWF0Y2ggLyVzL1xuIiwgcywgcGF0dGVybik7CiAgICB9CiAgZWxz ZQogICAgewogICAgICBwcmludGYoInJlZ2V4ZWM6ICVzIG1hdGNoZWQgLyVz L1xuIiwgcywgcGF0dGVybik7CiAgICB9CiAgcmVnZnJlZSgmcmVnKTsKCiAg aWYgKGZubWF0Y2gocGF0dGVybiwgcywgMCkgPT0gRk5NX05PTUFUQ0gpCiAg ICB7CiAgICAgIHByaW50ZigiZm5tYXRjaDogJXMgZGlkIG5vdCBtYXRjaCAv JXMvXG4iLCBzLCBwYXR0ZXJuKTsKICAgIH0KICBlbHNlCiAgICB7CiAgICAg IHByaW50ZigiZm5tYXRjaDogJXMgbWF0Y2hlZCAvJXMvXG4iLCBzLCBwYXR0 ZXJuKTsKICAgIH0KfQo= --------------070300020907010102090601 Content-Type: text/plain; charset=us-ascii Content-length: 218 -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple --------------070300020907010102090601--