Properly handle recursion in recurse()

The restructuring of recurse() in the last few weeks actually broke
the recursion-flags in different tools.
As a long-term goal, the recursor should have a field "maxdepth"
which should be "1" for the non-Rflag-case. "0" stands for unlimited.
This commit is contained in:
FRIGN
2015-04-18 21:24:17 +02:00
committed by sin
parent e2edbdcb87
commit e14d9412f8
8 changed files with 24 additions and 20 deletions

1
mv.c
View File

@@ -19,7 +19,6 @@ mv(const char *s1, const char *s2, int depth)
if (errno == EXDEV) {
cp_aflag = cp_rflag = cp_pflag = 1;
cp_follow = 'P';
rm_rflag = 1;
cp(s1, s2, depth);
rm(s1, NULL, NULL, &r);
return (mv_status = cp_status || rm_status);