Mercurial > repo
view git-master/test-regex.c @ 2765:0e687eac0f29
<ThatOtherPerson> mv DCPUToolBot-master d
author | HackBot |
---|---|
date | Mon, 22 Apr 2013 15:40:20 +0000 |
parents | e59711901a63 |
children |
line wrap: on
line source
#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); }