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/fs/smbfs/smbfs_vnops.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/fs/smbfs/smbfs_vnops.c')
-rw-r--r-- | sys/fs/smbfs/smbfs_vnops.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/fs/smbfs/smbfs_vnops.c b/sys/fs/smbfs/smbfs_vnops.c index 830c249..a236ca7 100644 --- a/sys/fs/smbfs/smbfs_vnops.c +++ b/sys/fs/smbfs/smbfs_vnops.c @@ -1039,7 +1039,7 @@ smbfs_pathcheck(struct smbmount *smp, const char *name, int nmlen, int nameiop) * Backslash characters, being a path delimiter, are prohibited * within a path component even for LOOKUP operations. */ - if (index(name, '\\') != NULL) + if (strchr(name, '\\') != NULL) return ENOENT; if (nameiop == LOOKUP) @@ -1051,20 +1051,20 @@ smbfs_pathcheck(struct smbmount *smp, const char *name, int nmlen, int nameiop) */ if (nmlen > 12) return ENAMETOOLONG; - cp = index(name, '.'); + cp = strchr(name, '.'); if (cp == NULL) return error; if (cp == name || (cp - name) > 8) return error; - cp = index(cp + 1, '.'); + cp = strchr(cp + 1, '.'); if (cp != NULL) return error; for (cp = name, i = 0; i < nmlen; i++, cp++) - if (index(badchars83, *cp) != NULL) + if (strchr(badchars83, *cp) != NULL) return error; } for (cp = name, i = 0; i < nmlen; i++, cp++) - if (index(badchars, *cp) != NULL) + if (strchr(badchars, *cp) != NULL) return error; return 0; } |