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:
4
rm.c
4
rm.c
@@ -11,7 +11,7 @@ usage(void)
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
struct recursor r = { .fn = rm, .hist = NULL, .depth = 0, .follow = 'P', .flags = 0};
|
||||
struct recursor r = { .fn = rm, .hist = NULL, .depth = 0, .follow = 'P', .flags = NODIRS };
|
||||
|
||||
ARGBEGIN {
|
||||
case 'f':
|
||||
@@ -19,7 +19,7 @@ main(int argc, char *argv[])
|
||||
break;
|
||||
case 'R':
|
||||
case 'r':
|
||||
rm_rflag = 1;
|
||||
r.flags &= ~NODIRS;
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
|
Reference in New Issue
Block a user