test-fnmatch.c (206710) | test-fnmatch.c (206711) |
---|---|
1/*- 2 * Copyright (c) 2010 Jilles Tjoelker 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2010 Jilles Tjoelker 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/tools/regression/lib/libc/gen/test-fnmatch.c 206710 2010-04-16 22:15:26Z jilles $"); | 28__FBSDID("$FreeBSD: head/tools/regression/lib/libc/gen/test-fnmatch.c 206711 2010-04-16 22:29:24Z jilles $"); |
29 30#include <errno.h> 31#include <stdio.h> 32#include <stdlib.h> 33#include <string.h> 34#include <fnmatch.h> 35 36struct testcase { --- 132 unchanged lines hidden (view full) --- 169 "*", "a/b", FNM_PATHNAME, FNM_NOMATCH, 170 "*b", "a/b", FNM_PATHNAME, FNM_NOMATCH, 171 "a", "a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0, 172 "*", "a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0, 173 "*", ".a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0, 174 "*a", ".a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0, 175 "*", ".a/b", FNM_PATHNAME | FNM_PERIOD | FNM_LEADING_DIR, FNM_NOMATCH, 176 "*a", ".a/b", FNM_PATHNAME | FNM_PERIOD | FNM_LEADING_DIR, FNM_NOMATCH, | 29 30#include <errno.h> 31#include <stdio.h> 32#include <stdlib.h> 33#include <string.h> 34#include <fnmatch.h> 35 36struct testcase { --- 132 unchanged lines hidden (view full) --- 169 "*", "a/b", FNM_PATHNAME, FNM_NOMATCH, 170 "*b", "a/b", FNM_PATHNAME, FNM_NOMATCH, 171 "a", "a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0, 172 "*", "a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0, 173 "*", ".a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0, 174 "*a", ".a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0, 175 "*", ".a/b", FNM_PATHNAME | FNM_PERIOD | FNM_LEADING_DIR, FNM_NOMATCH, 176 "*a", ".a/b", FNM_PATHNAME | FNM_PERIOD | FNM_LEADING_DIR, FNM_NOMATCH, |
177 "a*b/*", "abbb/.x", FNM_PATHNAME | FNM_PERIOD, FNM_NOMATCH, |
|
177}; 178 179static const char * 180flags_to_string(int flags) 181{ 182 static const int flagvalues[] = { FNM_NOESCAPE, FNM_PATHNAME, 183 FNM_PERIOD, FNM_LEADING_DIR, FNM_CASEFOLD, 0 }; 184 static const char flagnames[] = "FNM_NOESCAPE\0FNM_PATHNAME\0FNM_PERIOD\0FNM_LEADING_DIR\0FNM_CASEFOLD\0"; --- 151 unchanged lines hidden --- | 178}; 179 180static const char * 181flags_to_string(int flags) 182{ 183 static const int flagvalues[] = { FNM_NOESCAPE, FNM_PATHNAME, 184 FNM_PERIOD, FNM_LEADING_DIR, FNM_CASEFOLD, 0 }; 185 static const char flagnames[] = "FNM_NOESCAPE\0FNM_PATHNAME\0FNM_PERIOD\0FNM_LEADING_DIR\0FNM_CASEFOLD\0"; --- 151 unchanged lines hidden --- |