Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2012-10-15 10:25:57 +0400
committerJunio C Hamano <gitster@pobox.com>2012-10-16 01:58:18 +0400
commit3ae5396cf719000039c5d0d35f9bf934f647b030 (patch)
treea12424227ae05d6db8c52c405b06ea7c5fcc09f9 /test-wildmatch.c
parentf1cf7b798305787d5d1272c13ead207e3e04a183 (diff)
wildmatch: make wildmatch's return value compatible with fnmatch
wildmatch returns non-zero if matched, zero otherwise. This patch makes it return zero if matches, non-zero otherwise, like fnmatch(). Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'test-wildmatch.c')
-rw-r--r--test-wildmatch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/test-wildmatch.c b/test-wildmatch.c
index ac5642037d..77014e99dc 100644
--- a/test-wildmatch.c
+++ b/test-wildmatch.c
@@ -4,9 +4,9 @@
int main(int argc, char **argv)
{
if (!strcmp(argv[1], "wildmatch"))
- return wildmatch(argv[3], argv[2]) ? 0 : 1;
+ return !!wildmatch(argv[3], argv[2]);
else if (!strcmp(argv[1], "iwildmatch"))
- return iwildmatch(argv[3], argv[2]) ? 0 : 1;
+ return !!iwildmatch(argv[3], argv[2]);
else if (!strcmp(argv[1], "fnmatch"))
return !!fnmatch(argv[3], argv[2], FNM_PATHNAME);
else