From: Andreas Henriksson <andreas.henriksson@xxxxxxxxx> The command "touch b0;rename.ul -v ./b0 ./b1 ./b0" used to work before "allow renaming in subdirectories" change. (regression in commit bd9ced628bb86) Addresses: https://bugs.debian.org/789240 Reported-by: gregrwm <bug-grub@xxxxxxxxxxxxxxx> Signed-off-by: Andreas Henriksson <andreas@xxxxxxxx> --- misc-utils/rename.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/misc-utils/rename.c b/misc-utils/rename.c index 7ac068d..c8a4f8c 100644 --- a/misc-utils/rename.c +++ b/misc-utils/rename.c @@ -92,10 +92,11 @@ static int do_symlink(char *from, char *to, char *s, int verbose) static int do_file(char *from, char *to, char *s, int verbose) { - char *newname = NULL, *file; + char *newname = NULL, *file=NULL; int ret = 1; - file = strrchr(s, '/'); + if (strchr(from, '/') == NULL && strchr(to, '/') == NULL) + file = strrchr(s, '/'); if (file == NULL) file = s; if (string_replace(from, to, file, s, &newname)) -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe util-linux" in