sbase

suckless unix tools
git clone git://git.2f30.org/sbase.git
Log | Files | Refs | README | LICENSE

commit 4f9626701dcc2868dd9bfa580e210fadc4fd5055
parent dcf95aa57d1488813ca2497084fe57c803828009
Author: sin <sin@2f30.org>
Date:   Fri Nov 13 14:12:09 +0000

mv: Ensure stat is initialized when we prune a tree

This can happen if you move a file from one filesystem to another.
rename(2) will fail and we will fall through to a manual cp + rm.
Initiate the rm through recurse() like we do for rm(1).

Thanks to Heiko for reporting this.

Diffstat:
mv.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mv.c b/mv.c @@ -21,7 +21,7 @@ mv(const char *s1, const char *s2, int depth) cp_aflag = cp_rflag = cp_pflag = 1; cp_follow = 'P'; cp(s1, s2, depth); - rm(s1, NULL, NULL, &r); + recurse(s1, NULL, &r); return (mv_status = cp_status || rm_status); } mv_status = 1;