summaryrefslogtreecommitdiffstats
path: root/usr.bin/locate
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/locate')
-rw-r--r--usr.bin/locate/locate/fastfind.c2
-rw-r--r--usr.bin/locate/locate/util.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/locate/locate/fastfind.c b/usr.bin/locate/locate/fastfind.c
index 21148bc..c15730b 100644
--- a/usr.bin/locate/locate/fastfind.c
+++ b/usr.bin/locate/locate/fastfind.c
@@ -167,7 +167,7 @@ fastfind
/* find optimal (last) char for searching */
for (p = pathpart; *p != '\0'; p++)
- if (index(LOCATE_REG, *p) != NULL)
+ if (strchr(LOCATE_REG, *p) != NULL)
break;
if (*p == '\0')
diff --git a/usr.bin/locate/locate/util.c b/usr.bin/locate/locate/util.c
index 7b9fe49..d00a9a3 100644
--- a/usr.bin/locate/locate/util.c
+++ b/usr.bin/locate/locate/util.c
@@ -162,7 +162,7 @@ patprep(name)
/* skip trailing metacharacters */
for (; p >= name; p--)
- if (index(LOCATE_REG, *p) == NULL)
+ if (strchr(LOCATE_REG, *p) == NULL)
break;
/*
@@ -172,7 +172,7 @@ patprep(name)
* |----< p
*/
if (p >= name &&
- (index(p, '[') != NULL || index(p, ']') != NULL)) {
+ (strchr(p, '[') != NULL || strchr(p, ']') != NULL)) {
for (p = name; *p != '\0'; p++)
if (*p == ']' || *p == '[')
break;
@@ -183,7 +183,7 @@ patprep(name)
* '*\*[a-z]'
* |-------< p
*/
- if (p >= name && index(LOCATE_REG, *p) != NULL)
+ if (p >= name && strchr(LOCATE_REG, *p) != NULL)
p = name - 1;
}
@@ -193,7 +193,7 @@ patprep(name)
else {
for (endmark = p; p >= name; p--)
- if (index(LOCATE_REG, *p) != NULL)
+ if (strchr(LOCATE_REG, *p) != NULL)
break;
for (++p;
(p <= endmark) && subp < (globfree + sizeof(globfree));)
OpenPOWER on IntegriCloud