[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [PATCH] lineedit: fix matching of directories when searching PATH
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2023-03-29 14:46:53
Message-ID: CAK1hOcMQgugGG+gzJB3QxOR7adQzpY2aapxzf5+oyRJ=V-gFEQ () mail ! gmail ! com
[Download RAW message or body]

Applied, thank you.

On Fri, Mar 24, 2023 at 4:25 PM Ron Yorston <rmy@pobox.com> wrote:
>
> Commit 8baa643a3 (lineedit: match local directories when searching
> PATH) included subdirectories of the current directory in the search
> when tab-completing commands.
>
> Unfortunately a short time later commit 1d180cd74 (lineedit: use
> strncmp instead of is_prefixed_with (we know the length)) broke
> this feature by returning an incorrect length for the array of paths.
>
> Fix the length and reinstate matching of subdirectories.
>
> Signed-off-by: Ron Yorston <rmy@pobox.com>
> ---
>  libbb/lineedit.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libbb/lineedit.c b/libbb/lineedit.c
> index b942f540a..625884adf 100644
> --- a/libbb/lineedit.c
> +++ b/libbb/lineedit.c
> @@ -825,8 +825,8 @@ static unsigned path_parse(char ***p)
>                 res[npth++] = tmp;
>         }
>         /* special case: "match subdirectories of the current directory" */
> -       /*res[npth++] = NULL; - filled by xzalloc() */
> -       return npth;
> +       /*res[npth] = NULL; - filled by xzalloc() */
> +       return npth + 1;
>  }
>
>  /* Complete command, directory or file name.
> --
> 2.39.2
>
> _______________________________________________
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic