[Toybox] [PATCH] Stop "ls nonexistent" from segfaulting

enh enh at google.com
Mon Jun 15 11:57:36 PDT 2015


and add a test to the test scripts?

On Mon, Jun 15, 2015 at 9:44 AM, Felix Janda <felix.janda at posteo.de> wrote:

> ---
> Maybe it is better to have the test somewhere else.
> ---
>  toys/posix/ls.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/toys/posix/ls.c b/toys/posix/ls.c
> index 15796ff..3346968 100644
> --- a/toys/posix/ls.c
> +++ b/toys/posix/ls.c
> @@ -539,7 +539,7 @@ void ls_main(void)
>    for (dt = TT.files->child; dt; dt = dt->next) dt->parent = TT.files;
>
>    // Display the files we collected
> -  listfiles(AT_FDCWD, TT.files);
> +  if (TT.files->child) listfiles(AT_FDCWD, TT.files);
>
>    if (CFG_TOYBOX_FREE) free(TT.files);
>  }
> --
> 2.3.6
> _______________________________________________
> Toybox mailing list
> Toybox at lists.landley.net
> http://lists.landley.net/listinfo.cgi/toybox-landley.net
>



-- 
Elliott Hughes - http://who/enh - http://jessies.org/~enh/
Android native code/tools questions? Mail me/drop by/add me as a reviewer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20150615/dc7e09e4/attachment-0003.htm>


More information about the Toybox mailing list