mirror of
https://github.com/git/git.git
synced 2024-12-05 07:53:59 +08:00
de61cebde7
* jk/common-main-2.8: mingw: declare main()'s argv as const common-main: call git_setup_gettext() common-main: call restore_sigpipe_to_default() common-main: call sanitize_stdfds() common-main: call git_extract_argv0_path() add an extra level of indirection to main()
21 lines
544 B
C
21 lines
544 B
C
#include "git-compat-util.h"
|
|
|
|
int cmd_main(int argc, const 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);
|
|
}
|