diff options
author | wosch <wosch@FreeBSD.org> | 1996-10-20 16:54:51 +0000 |
---|---|---|
committer | wosch <wosch@FreeBSD.org> | 1996-10-20 16:54:51 +0000 |
commit | 22623bf1c5b06ef7648156386526b0246ec6440b (patch) | |
tree | fabb733e6e5740421d24035f24214e38e955c821 /usr.bin | |
parent | 085d68ca3b32f461a9696ba337611b65e7a3e6a2 (diff) | |
download | FreeBSD-src-22623bf1c5b06ef7648156386526b0246ec6440b.zip FreeBSD-src-22623bf1c5b06ef7648156386526b0246ec6440b.tar.gz |
Better case insensitve search support for pattern with meta chars.
In some rare cases this does not work proper before flag FNM_ICASE was
added to fnmatch(3).
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/locate/locate/fastfind.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/usr.bin/locate/locate/fastfind.c b/usr.bin/locate/locate/fastfind.c index c175c18..dd95287 100644 --- a/usr.bin/locate/locate/fastfind.c +++ b/usr.bin/locate/locate/fastfind.c @@ -34,7 +34,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: fastfind.c,v 1.2 1996/10/09 00:33:32 wosch Exp $ + * $Id: fastfind.c,v 1.3 1996/10/13 01:44:34 wosch Exp $ */ @@ -300,7 +300,14 @@ fastfind break; if (*p == '\0') { /* fast match success */ found = 1; - if (!globflag || !fnmatch(pathpart, path, 0)) { + if (!globflag || +#ifndef FF_ICASE + !fnmatch(pathpart, path, 0)) +#else + !fnmatch(pathpart, path, + FNM_ICASE)) +#endif /* !FF_ICASE */ + { if (f_silent) counter++; else if (f_limit) { |