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/kern/kern_linker.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/kern/kern_linker.c')
-rw-r--r-- | sys/kern/kern_linker.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index d7e5ade..74fe19f 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -1013,7 +1013,7 @@ kern_kldload(struct thread *td, const char *file, int *fileid) * (kldname.ko, or kldname.ver.ko) treat it as an interface * name. */ - if (index(file, '/') || index(file, '.')) { + if (strchr(file, '/') || strchr(file, '.')) { kldname = file; modname = NULL; } else { @@ -1906,7 +1906,7 @@ linker_search_kld(const char *name) int len; /* qualified at all? */ - if (index(name, '/')) + if (strchr(name, '/')) return (linker_strdup(name)); /* traverse the linker path */ @@ -1927,7 +1927,7 @@ linker_basename(const char *path) { const char *filename; - filename = rindex(path, '/'); + filename = strrchr(path, '/'); if (filename == NULL) return path; if (filename[1]) |