aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/gen/fnmatch.c
Commit message (Collapse)AuthorAgeFilesLines
* Clean up the vcs ID strings in libc's gen/ directory.John Baldwin2018-07-031-3/+1
| | | | | | | | | | | | | | | | | | | | - Move CSRG IDs into __SCCSID(). - When a file has been copied, consistently use 'From: <tag>' for strings referencing the version of the source file copied from in the license block comment. - Some of the 'From:' tags were using $FreeBSD$ that was being expanded on each checkout. Fix those to hardcode the FreeBSD tag from the file that was copied at the time of the copy. - When multiple strings are present list them in "chronological" order, so CSRG (__SCCSID) before FreeBSD (__FBSDID). If a file came from OtherBSD and contains a CSRG ID from the OtherBSD file, use the order CSRG -> OtherBSD -> FreeBSD. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D15831 Notes: svn path=/head/; revision=335898
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-1/+3
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* libc: minor indent(1) cleanups.Pedro F. Giffuni2017-08-261-1/+1
| | | | | | | | | | | | | | Illumos and Schillix is adopting some of the locale code and our style(9) sometimes matches the Solaris cstyle, so the changes are also useful as a way to reduce diffs. No functional change. Discussed with: Joerg Schilling MFC after: 1 week Notes: svn path=/head/; revision=322925
* fnmatch(3): improve POSIX conformance.Pedro F. Giffuni2017-08-101-1/+2
| | | | | | | | | | | | | | | | In a recent interpretation[1], "\\" shall return a non-zero value (indicating either no match or an error). The fix involves a change over r254091 and now the behavior matches the Sun/IBM/HP closed source implementations and also likely musl libc. Submitted by: Joerg Schilling <joerg at schily.net> MFC after: 1 week [1] http://austingroupbugs.net/view.php?id=806 Notes: svn path=/head/; revision=322368
* Renumber copyright clause 4Warner Losh2017-02-281-1/+1
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* 1) Eliminate possibility to call __*collate_range_cmp() with inclompleteAndrey A. Chernov2016-07-141-2/+2
| | | | | | | | | | | | | | | locale (which cause core dump) by removing whole 'table' argument by which it passed. 2) Restore __collate_range_cmp() in __sccl(). 3) Collating [a-z] range in regcomp() only for single bytes locales (we can't do it now for other ones). In previous state only first 256 wchars are considered and all others are just silently dropped from the range. Notes: svn path=/head/; revision=302824
* Back out non-collating [a-z] ranges.Andrey A. Chernov2016-07-141-1/+9
| | | | | | | | | | Instead of changing whole course to another POSIX-permitted way for consistency and uniformity I decide to completely ignore missing regex fucntionality and concentrace on fixing bugs in what we have now, too many small obstacles instead, counting ports. Notes: svn path=/head/; revision=302820
* Remove broken support for collation in [a-z] type ranges.Andrey A. Chernov2016-07-101-9/+1
| | | | | | | | | | | | | | | | | | | | | Only first 256 wide chars are considered currently, all other are just dropped from the range. Proper implementation require reverse tables database lookup, since objects are really big as max UTF-8 (1114112 code points), so just the same scanning as it was for 256 chars will slow things down. POSIX does not require collation for [a-z] type ranges and does not prohibit it for non-POSIX locales. POSIX require collation for ranges only for POSIX (or C) locale which is equal to ASCII and binary for other chars, so we already have it. No other *BSD implements collation for [a-z] type ranges. Restore ABI compatibility with unused now __collate_range_cmp() which is visible from outside (will be removed later). Notes: svn path=/head/; revision=302512
* libc/locale: Fix type breakage in __collate_range_cmp().Pedro F. Giffuni2016-06-051-2/+2
| | | | | | | | | | | | | | | | | | | When collation support was brought in, the second and third arguments in __collate_range_cmp() were changed from int to wchar_t, breaking the ABI. Change them to a "char" type which makes more sense and keeps the ABI compatible. Also introduce __wcollate_range_cmp() which does work with wide characters. This function is used only internally in libc so we don't export it. Use the new function in glob(3), fnmatch(3), and regexec(3). PR: 179721 Suggested by: ache. jilles MFC after: 3 weeks (perhaps partial only) Notes: svn path=/head/; revision=301461
* fnmatch(): Remove exponential behaviour as in sh r229201.Jilles Tjoelker2015-09-271-28/+49
| | | | | | | | | The old code was exponential in the number of asterisks in the pattern. However, once a match has been found upto the next asterisk, the previous asterisks are no longer relevant. Notes: svn path=/head/; revision=288309
* Use ANSI C prototypes. Eliminates -Wold-style-definition warnings.Craig Rodrigues2015-09-201-13/+5
| | | | Notes: svn path=/head/; revision=288029
* According to POSIX \ in the fnmatch(3) pattern should escapeAndrey A. Chernov2013-08-081-2/+0
| | | | | | | | | | | | | any character including '\0', but our version replace escaped '\0' with '\\'. I.e. fnmatch("\\", "\\", 0) should not match while fnmatch("\\", "", 0) should (Linux and NetBSD does the same). Was vice versa. PR: 181129 MFC after: 1 week Notes: svn path=/head/; revision=254091
* Implement xlocale APIs from Darwin, mainly for use by libc++. This adds aDavid Chisnall2011-11-201-3/+10
| | | | | | | | | | | | | | | load of _l suffixed versions of various standard library functions that use the global locale, making them take an explicit locale parameter. Also adds support for per-thread locales. This work was funded by the FreeBSD Foundation. Please test any code you have that uses the C standard locale functions! Reviewed by: das (gdtoa changes) Approved by: dim (mentor) Notes: svn path=/head/; revision=227753
* fnmatch: Fix bad FNM_PERIOD disabling if an asterisk has been seen.Jilles Tjoelker2010-04-161-8/+8
| | | | | | | | | | Example: fnmatch("a*b/*", "abbb/.x", FNM_PATHNAME | FNM_PERIOD) PR: 116074 MFC after: 1 week Notes: svn path=/head/; revision=206711
* Per Regents of the University of Calfornia letter, remove advertisingWarner Losh2007-01-091-4/+0
| | | | | | | | | clause. # If I've done so improperly on a file, please let me know. Notes: svn path=/head/; revision=165903
* Remove unused variables and assignments.Stefan Farfeleder2005-04-081-1/+0
| | | | Notes: svn path=/head/; revision=144816
* Add support for multibyte characters.Tim J. Robbins2004-07-291-49/+112
| | | | Notes: svn path=/head/; revision=132812
* * Remove __P and convert to ANSI prototypes.David E. O'Brien2002-02-011-1/+3
| | | | | | | | * Remove 'register'. (some functions had 7+ register functions...) * Fix SCM ID's. Notes: svn path=/head/; revision=90045
* Style optimization in newly added POSIX range []] conformance, redoAndrey A. Chernov1997-06-071-6/+6
| | | | | | | 'for' loop as do...while and remove variable unneded now Notes: svn path=/head/; revision=26492
* Add missing FNM_PERIOD check for '[' rangeAndrey A. Chernov1997-06-061-4/+10
| | | | | | | | Don't treat !^ as first characters in the range, just as negate sign [/] never match if FNM_PATHNAME Notes: svn path=/head/; revision=26486
* 1) Now conforms POSIX.2 2.8.3.2 requirements about []] patternAndrey A. Chernov1997-06-061-11/+35
| | | | | | | 2) Treat unclosed [ range in pattern as regular characters (bash style) Notes: svn path=/head/; revision=26484
* Fix a bug that caused some false mismatches when both FNM_PATHNAMEJohn Polstra1997-04-291-1/+2
| | | | | | | | | and FNM_LEADING_DIR were specified and the pattern ended with "*". Example: pattern="src/usr.sbin/w*", string="src/usr.sbin/watch/watch.8,v". This should match, but did not. Notes: svn path=/head/; revision=25269
* Eliminate some function calls when locale not usedAndrey A. Chernov1997-04-041-6/+4
| | | | Notes: svn path=/head/; revision=24632
* Speedup in case locale not usedAndrey A. Chernov1997-04-041-2/+6
| | | | Notes: svn path=/head/; revision=24630
* collate_range_cmp -> __collate_range_cmpAndrey A. Chernov1996-10-311-3/+4
| | | | Notes: svn path=/head/; revision=19276
* GNU-style changes:Andrey A. Chernov1996-10-231-10/+14
| | | | | | | | | | 1) Rename FNM_ICASE to FNM_CASEFOLD 2) Add FNM_LEADING_DIR Add proper (unsigned char) casts to tolower(). Use 'char' function argument for proper sign extension Notes: svn path=/head/; revision=19132
* add flag FNM_ICASE for case insensitve searchWolfram Schneider1996-10-201-1/+20
| | | | | | | Reviewed by: ache Notes: svn path=/head/; revision=19059
* Convert to newly aded collate compare functionAndrey A. Chernov1996-08-121-3/+3
| | | | Notes: svn path=/head/; revision=17552
* Use collate for alpha character rangesAndrey A. Chernov1996-08-121-1/+4
| | | | Notes: svn path=/head/; revision=17533
* General -Wall warning cleanup, part I.Jordan K. Hubbard1996-07-121-1/+1
| | | | | | | Submitted-By: Kent Vander Velden <graphix@iastate.edu> Notes: svn path=/head/; revision=17141
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-2/+2
| | | | Notes: svn path=/head/; revision=8870
* BSD 4.4 Lite Lib SourcesRodney W. Grimes1994-05-271-0/+171
Notes: svn path=/cvs2svn/branches/unlabeled-1.1.1/; revision=1573