[Toybox] another dirtree regression

enh enh at google.com
Tue Oct 6 14:03:34 PDT 2020


yeah, that patch fixes it for me. i'll sync AOSP.

thanks!

On Tue, Oct 6, 2020 at 1:43 PM Rob Landley <rob at landley.net> wrote:

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20201006/6e9d0a05/attachment-0001.htm>


More information about the Toybox mailing list