From 2fc5a0d5bc3609d69863ba45de850e659d5e60f6 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sun, 8 Feb 2015 20:44:40 +0000 Subject: [PATCH] rename: use strrchr() instead of rindex() The rindex() is marked legacy in POSIX.1-2001, and apparently Androids bionic libc does not even have it so it is best not to use the legacy interface. Reference: https://lists.gnu.org/archive/html/weechat-dev/2014-02/msg00004.html Signed-off-by: Sami Kerola --- misc-utils/rename.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc-utils/rename.c b/misc-utils/rename.c index f9cc3a5d25..7ac068d639 100644 --- a/misc-utils/rename.c +++ b/misc-utils/rename.c @@ -95,7 +95,7 @@ static int do_file(char *from, char *to, char *s, int verbose) char *newname = NULL, *file; int ret = 1; - file = rindex(s, '/'); + file = strrchr(s, '/'); if (file == NULL) file = s; if (string_replace(from, to, file, s, &newname)) -- 2.47.3