From feabcc173b7a5f55c2b1ec78f230276c63ae4d36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Mon, 15 Oct 2012 13:25:55 +0700 Subject: Integrate wildmatch to git MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- test-wildmatch.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test-wildmatch.c (limited to 'test-wildmatch.c') diff --git a/test-wildmatch.c b/test-wildmatch.c new file mode 100644 index 0000000000..ac5642037d --- /dev/null +++ b/test-wildmatch.c @@ -0,0 +1,14 @@ +#include "cache.h" +#include "wildmatch.h" + +int main(int argc, char **argv) +{ + if (!strcmp(argv[1], "wildmatch")) + return wildmatch(argv[3], argv[2]) ? 0 : 1; + else if (!strcmp(argv[1], "iwildmatch")) + return iwildmatch(argv[3], argv[2]) ? 0 : 1; + else if (!strcmp(argv[1], "fnmatch")) + return !!fnmatch(argv[3], argv[2], FNM_PATHNAME); + else + return 1; +} -- cgit v1.2.1