From: Sami Kerola Date: Sun, 8 Feb 2015 20:44:40 +0000 (+0000) Subject: rename: use strrchr() instead of rindex() X-Git-Tag: v2.26~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2fc5a0d5bc3609d69863ba45de850e659d5e60f6;p=thirdparty%2Futil-linux.git 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 --- 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))