summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dirname.c2
-rw-r--r--src/echo.c2
-rw-r--r--src/env.c2
-rw-r--r--src/pathchk.c4
-rw-r--r--src/printf.c6
-rw-r--r--src/who.c2
6 files changed, 9 insertions, 9 deletions
diff --git a/src/dirname.c b/src/dirname.c
index 7a0c834ea..e4bdf26ef 100644
--- a/src/dirname.c
+++ b/src/dirname.c
@@ -75,7 +75,7 @@ main (argc, argv)
path = argv[1];
strip_trailing_slashes (path);
- slash = rindex (path, '/');
+ slash = strrchr (path, '/');
if (slash == NULL)
path = (char *) ".";
else
diff --git a/src/echo.c b/src/echo.c
index ee2402a39..205367915 100644
--- a/src/echo.c
+++ b/src/echo.c
@@ -134,7 +134,7 @@ main (argc, argv)
for (i = 0; temp[i]; i++)
{
- if (rindex (VALID_ECHO_OPTIONS, temp[i]) == 0)
+ if (strrchr (VALID_ECHO_OPTIONS, temp[i]) == 0)
goto just_echo;
}
diff --git a/src/env.c b/src/env.c
index 19c2a62c1..53be05639 100644
--- a/src/env.c
+++ b/src/env.c
@@ -166,7 +166,7 @@ main (argc, argv, envp)
if (optind != argc && !strcmp (argv[optind], "-"))
++optind;
- while (optind < argc && index (argv[optind], '='))
+ while (optind < argc && strchr (argv[optind], '='))
putenv (argv[optind++]);
/* If no program is specified, print the environment and exit. */
diff --git a/src/pathchk.c b/src/pathchk.c
index a34df0929..774620f3a 100644
--- a/src/pathchk.c
+++ b/src/pathchk.c
@@ -289,13 +289,13 @@ validate_path (path, portability)
while (*slash == '/')
slash++;
start = slash;
- slash = index (slash, '/');
+ slash = strchr (slash, '/');
if (slash != NULL)
*slash = '\0';
else
{
last_elem = 1;
- slash = index (start, '\0');
+ slash = strchr (start, '\0');
}
if (!last_elem)
diff --git a/src/printf.c b/src/printf.c
index e437abe13..9e443dfd9 100644
--- a/src/printf.c
+++ b/src/printf.c
@@ -199,7 +199,7 @@ print_formatted (format, argc, argv)
}
break;
}
- if (index ("-+ #", *f))
+ if (strchr ("-+ #", *f))
{
++f;
++direc_length;
@@ -252,7 +252,7 @@ print_formatted (format, argc, argv)
++f;
++direc_length;
}
- if (!index ("diouxXfeEgGcs", *f))
+ if (!strchr ("diouxXfeEgGcs", *f))
error (1, 0, "%%%c: invalid directive", *f);
++direc_length;
if (argc > 0)
@@ -310,7 +310,7 @@ print_esc (escstart)
esc_value = esc_value * 8 + octtobin (*p);
putchar (esc_value);
}
- else if (index ("\"\\abcfnrtv", *p))
+ else if (strchr ("\"\\abcfnrtv", *p))
print_esc_char (*p++);
else
error (1, 0, "\\%c: invalid escape", *p);
diff --git a/src/who.c b/src/who.c
index e9e962898..7cbe51807 100644
--- a/src/who.c
+++ b/src/who.c
@@ -150,7 +150,7 @@ extract_trimmed_name (const STRUCT_UTMP *ut)
/* Append a trailing space character. Some systems pad names shorter than
the maximum with spaces, others pad with NULs. Remove any spaces. */
trimmed_name[sizeof (ut->ut_name)] = ' ';
- p = index (trimmed_name, ' ');
+ p = strchr (trimmed_name, ' ');
if (p != NULL)
*p = '\0';
return trimmed_name;