[Toybox] another dirtree regression

Rob Landley rob at landley.net
Tue Oct 6 13:54:07 PDT 2020


On 10/6/20 3:02 PM, enh via Toybox wrote:
> the recent dirtree changes seem to have regressed find(1): `find /etc/ -maxdepth
> 1` now shows /etc//passwd rather than /etc/passwd.
> 
> haven't had chance to have a look at why yet...

Because I had a test that striped it in the recursive version, presumably
because I hit that but didn't add a test for it. The non-recursive rewrite
didn't include that test.

And I once again confirmed it's NOT normalizing the path:

  $ find /etc/ -maxdepth 1 | grep '/passwd$'
  /etc/passwd
  $ find /etc// -maxdepth 1 | grep '/passwd$'
  /etc//passwd
  $ find /etc/// -maxdepth 1 | grep '/passwd$'
  /etc///passwd

Just this single special case because special case. (Which can only happen with
the initial path because getdir() isn't going to return a trailing / on the
name. So my fix checking for it at every level isn't ideal, but eh. In a hurry.)

Added a test this time,

Rob



More information about the Toybox mailing list