Staging
v0.5.1
v0.5.1
Revision 87a5461fa7b30f7b7baf27204f10219d61500fbf authored by Junio C Hamano on 17 October 2012, 17:39:44 UTC, committed by Junio C Hamano on 17 October 2012, 17:39:44 UTC
Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 3d0a2d6
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);
}
Computing file changes ...