[PATCH 14/15] kbd-chooser: s/index/strchr/ s/rindex/strrchr/
replace obsolete functions by their successors.
Signed-off-by: maximilian attems <max@stro.at>
---
packages/kbd-chooser/findfile.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/packages/kbd-chooser/findfile.c b/packages/kbd-chooser/findfile.c
index 8e216fe..a8e6263 100644
--- a/packages/kbd-chooser/findfile.c
+++ b/packages/kbd-chooser/findfile.c
@@ -53,7 +53,7 @@ maybe_pipe_open(void) {
struct decompressor *dc;
if ((fp = fopen(pathname, "r")) != NULL) {
- t = rindex(pathname, '.');
+ t = strrchr(pathname, '.');
if (t) {
for (dc = &decompressors[0]; dc->cmd; dc++)
if (strcmp(t, dc->ext) == 0) {
@@ -77,7 +77,7 @@ findfile_in_dir(const char *fnam, char *dir, int recdepth, char **suf) {
ispipe = 0;
- ff = index(fnam, '/');
+ ff = strchr(fnam, '/');
if (ff) {
fdir = xstrdup(fnam);
fdir[ff-fnam] = 0; /* caller guarantees fdir != "" */
--
1.7.2.3
Reply to: