git config: Don't rely on regexec() returning 1 on non-match
Some systems don't return 1 from regexec() when the pattern does not match (notably HP-UX which returns 20). Bug identified by Dscho and H.Merijn Brand. Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de> Tested-by: H.Merijn Brand <h.m.brand@xs4all.nl> Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
21640376a5
commit
9e4bbeb95f
@ -38,8 +38,7 @@ static int show_config(const char* key_, const char* value_)
|
||||
if (use_key_regexp && regexec(key_regexp, key_, 0, NULL, 0))
|
||||
return 0;
|
||||
if (regexp != NULL &&
|
||||
(do_not_match ^
|
||||
regexec(regexp, (value_?value_:""), 0, NULL, 0)))
|
||||
(do_not_match ^ !!regexec(regexp, (value_?value_:""), 0, NULL, 0)))
|
||||
return 0;
|
||||
|
||||
if (show_keys) {
|
||||
|
Loading…
Reference in New Issue
Block a user