Revision f69f5f19cfae949b2bbd6c6ffbb990b6a00d04b0 authored by Junio C Hamano on 06 March 2015, 22:57:58 UTC, committed by Junio C Hamano on 06 March 2015, 22:57:58 UTC
Code cleanups.

* rj/no-xopen-source-for-cygwin:
  git-compat-util.h: remove redundant code
2 parent s f56a5f4 + 33baa69
Raw File
test-regex.c
#include "git-compat-util.h"

int main(int argc, char **argv)
{
	char *pat = "[^={} \t]+";
	char *str = "={}\nfred";
	regex_t r;
	regmatch_t m[1];

	if (regcomp(&r, pat, REG_EXTENDED | REG_NEWLINE))
		die("failed regcomp() for pattern '%s'", pat);
	if (regexec(&r, str, 1, m, 0))
		die("no match of pattern '%s' to string '%s'", pat, str);

	/* http://sourceware.org/bugzilla/show_bug.cgi?id=3957  */
	if (m[0].rm_so == 3) /* matches '\n' when it should not */
		die("regex bug confirmed: re-build git with NO_REGEX=1");

	exit(0);
}
back to top