mv: Prevent successful rename from forgetting past failure

This commit is contained in:
Michael Forney 2021-07-30 11:43:22 -07:00
parent 1cc5a57fd7
commit 688384568c

2
mv.c
View File

@ -16,7 +16,7 @@ mv(const char *s1, const char *s2, int depth)
struct recursor r = { .fn = rm, .follow = 'P' }; struct recursor r = { .fn = rm, .follow = 'P' };
if (!rename(s1, s2)) if (!rename(s1, s2))
return (mv_status = 0); return 0;
if (errno == EXDEV) { if (errno == EXDEV) {
cp_aflag = cp_rflag = cp_pflag = 1; cp_aflag = cp_rflag = cp_pflag = 1;
cp_follow = 'P'; cp_follow = 'P';