[Toybox] make menuconfig

Rob Landley rob at landley.net
Tue May 5 09:12:48 PDT 2015



On 05/04/2015 12:57 PM, Felix Janda wrote:
> Rob Landley wrote:
>> On 05/02/2015 02:54 PM, enh wrote:
>>> anyone else having trouble with "make menuconfig"? getprop and setprop
>>> aren't showing up for me, and i don't see where to set
>>> CONFIG_TOYBOX_ON_ANDROID and generated/mkflags segfaults if i have ls
>>> configured and...
>>>
>>> actually, downloading a clean toybox git repo, "make defconfig &&
>>> make" reproduces the segfault, so at least it's not Android-specific.
>>> posting early in case anyone's already debugged this...
>>
>> FYI I had a test wrong in the config parser. It was triggered by
>> configuring out a command line option that was the last (leftmost) short
>> option in a config that also had bare longopts.
> 
> I just wanted to say that not everything is yet fixed. For example
> 'ls --color' does not work at all. (Seems to be related to the option
> parsing.)

Hmmm... Yeah, I'm seeing that here too. I'll take a look, thanks.

> Also even on a terminal ls now only shows one directory per line. With the
> following hack, the previous behavior is restored in my case.
> 
> diff --git a/toys/posix/ls.c b/toys/posix/ls.c
> index 9c4d6d3..d783eca 100644
> --- a/toys/posix/ls.c
> +++ b/toys/posix/ls.c
> @@ -344,7 +344,7 @@ static void listfiles(int dirfd, struct dirtree *indir)
>          if (len[width]>totals[width]) totals[width] = len[width];
>        blocks += sort[ul]->st.st_blocks;
>      }
> -    totpad = totals[1]+!!totals[1]+totals[6]+!!totals[6]+totals[7]+!!totals[7];
> +    totpad = totals[1]+!!totals[1]+totals[6]+!!totals[6];//+totals[7]+!!totals[7];
>      if (flags & (FLAG_l|FLAG_o|FLAG_n|FLAG_g|FLAG_s) && indir->parent)
>        xprintf("total %llu\n", blocks);
>    }

*boggle*

totals[7] should be initialized to 0 in the non-Z case?

Oh. The one before it is doing the len[6] = test ? blah : 0; thing, but
it's got an if (blah) len[7] = thing;

I remember, I switched it to memset the whole array at the start of the
function, converting all those ? : assignments to just if() (so the
compiler could turn them into conditional assignments if it wanted to),
and then backed that out again for some reason. Right, my bad and easy
enough to fix.

(The earlier talk about a standard fileset would let me have
tests/ls.test regression tests to catch this stuff. It's on the todo
list...)

> Thanks,
> Felix

Rob

 1430842368.0


More information about the Toybox mailing list