sfind -depth -name combination seems broken
A Tool Box with tools written or managed by Jörg Schilling
Brought to you by:
schily
Some strange behaviour:
$ ./sfind/OBJ/x86_64-linux-gcc/sfind ./sfind/OBJ -name OBJ
./sfind/OBJ
$ ./sfind/OBJ/x86_64-linux-gcc/sfind ./sfind/OBJ -depth -name OBJ
$ ./sfind/OBJ/x86_64-linux-gcc/sfind ./sfind/OBJ -depth -name man
$ ./sfind/OBJ/x86_64-linux-gcc/sfind ./sfind/OBJ -depth -name sfind.1
./sfind/OBJ/x86_64-linux-gcc/man/sfind.1
./sfind/OBJ/x86_64-linux-gcc/man
$ ./sfind/OBJ/x86_64-linux-gcc/sfind ./sfind/OBJ -depth -name sfind
./sfind/OBJ/x86_64-linux-gcc/sfind
./sfind/OBJ/x86_64-linux-gcc
./sfind/OBJ
It may be that I missed some dependency quirks...
The directory is handled later in the function in case that -depth has been in use.
I thought that this does not cause problems, so I did not test that :-(
There was only a minor problem, caused by not restoring the last component index after processing the directory content. Please check the attached patch...
Seems to work!
So closed as it has been fixed last year