diff options
author | ed <ed@FreeBSD.org> | 2012-01-02 12:12:10 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2012-01-02 12:12:10 +0000 |
commit | ab210c8f2f4f0cd4839d93f66181fc7ad57ce8a9 (patch) | |
tree | c3375fb3aa9ccc6f33c26a511457552dfbab74a7 /sys/libkern/fnmatch.c | |
parent | d9de01105e6c2f60ef0fb2a67c0f3d915cef8c61 (diff) | |
download | FreeBSD-src-ab210c8f2f4f0cd4839d93f66181fc7ad57ce8a9.zip FreeBSD-src-ab210c8f2f4f0cd4839d93f66181fc7ad57ce8a9.tar.gz |
Use strchr() and strrchr().
It seems strchr() and strrchr() are used more often than index() and
rindex(). Therefore, simply migrate all kernel code to use it.
For the XFS code, remove an empty line to make the code identical to
the code in the Linux kernel.
Diffstat (limited to 'sys/libkern/fnmatch.c')
-rw-r--r-- | sys/libkern/fnmatch.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/libkern/fnmatch.c b/sys/libkern/fnmatch.c index d6cdc85..5e7bda6 100644 --- a/sys/libkern/fnmatch.c +++ b/sys/libkern/fnmatch.c @@ -89,12 +89,12 @@ fnmatch(const char *pattern, const char *string, int flags) if (c == EOS) if (flags & FNM_PATHNAME) return ((flags & FNM_LEADING_DIR) || - index(string, '/') == NULL ? + strchr(string, '/') == NULL ? 0 : FNM_NOMATCH); else return (0); else if (c == '/' && flags & FNM_PATHNAME) { - if ((string = index(string, '/')) == NULL) + if ((string = strchr(string, '/')) == NULL) return (FNM_NOMATCH); break; } |