From 688384568cba9f3e369434bf220b988da2f8357c Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Fri, 30 Jul 2021 11:43:22 -0700 Subject: [PATCH] mv: Prevent successful rename from forgetting past failure --- mv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mv.c b/mv.c index ee313f2..7cf0e5a 100644 --- a/mv.c +++ b/mv.c @@ -16,7 +16,7 @@ mv(const char *s1, const char *s2, int depth) struct recursor r = { .fn = rm, .follow = 'P' }; if (!rename(s1, s2)) - return (mv_status = 0); + return 0; if (errno == EXDEV) { cp_aflag = cp_rflag = cp_pflag = 1; cp_follow = 'P';