public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Mark Levedahl <mlevedahl@gmail.com>
To: cygwin@cygwin.com
Subject: regex library fails git tests
Date: Sat, 20 Jul 2013 21:26:00 -0000	[thread overview]
Message-ID: <ksepor$cag$1@ger.gmane.org> (raw)

Current git fails two sets of tests on cygwin due apparently to problems 
in the regex library. One set of tests does language based 
word-matching, and has a common failure during regex compilation. The 
suffix clause ("|[^[:space:]]|[\xc0-\xff][\x80-\xbf]+") is common to all 
of these, removing that clause eliminates the regcomp failure.

A test case extracted from the git sources is below - this works 
correctly on Fedora 18, fails on Cygwin:

$ gcc test-regex.c
$ ./a.out
failed regcomp() for pattern '[^<>=     ]+|[^[:space:]]|[â–’-â–’][â–’-â–’]+'

The failure disappears when the suffix clause is removed from pat_html.

This is happening on a current installation:
$ uname -a
CYGWIN_NT-5.1 virt-winxp 1.7.21(0.267/5/3) 2013-07-15 12:17 i686 Cygwin
$ cygcheck -c gcc-core gcc-g++
Cygwin Package Information
Package              Version        Status
gcc-core             4.7.3-1        OK
gcc-g++              4.7.3-1        OK

------------

#include <regex.h>
#include <stdio.h>

int main(int argc, char **argv)
{
	char *pat_html = "[^<>= \t]+"
		"|[^[:space:]]|[\xc0-\xff][\x80-\xbf]+";
	char *str = "={}\nfred";
	regex_t r;
	regmatch_t m[1];

	if (regcomp(&r, pat_html, REG_EXTENDED | REG_NEWLINE)) {
		printf("failed regcomp() for pattern '%s'\n", pat_html);
		return 1;
	}
	if (regexec(&r, str, 1, m, 0)) {
		printf("no match of pattern '%s' to string '%s'\n",
			   pat_html, str);
		return 1;
	}
	return 0;
}

Mark


--
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

             reply	other threads:[~2013-07-20 19:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-20 21:26 Mark Levedahl [this message]
2013-07-22  2:59 ` Corinna Vinschen
2013-07-22  8:07   ` Mark Levedahl
2013-07-22 10:32     ` Corinna Vinschen
2013-07-22 19:19       ` Eric Blake
2013-07-22 21:26         ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='ksepor$cag$1@ger.gmane.org' \
    --to=mlevedahl@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).