path = argv[1];
strip_trailing_slashes (path);
- slash = rindex (path, '/');
+ slash = strrchr (path, '/');
if (slash == NULL)
path = (char *) ".";
else
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;
}
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. */
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)
}
break;
}
- if (index ("-+ #", *f))
+ if (strchr ("-+ #", *f))
{
++f;
++direc_length;
++f;
++direc_length;
}
- if (!index ("diouxXfeEgGcs", *f))
+ if (!strchr ("diouxXfeEgGcs", *f))
error (1, 0, "%%%c: invalid directive", *f);
++direc_length;
if (argc > 0)
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);
/* 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;