<div dir="ltr">Just ran it through a short suite of tests on my end and all looks good here.<div>Thanks for the cleanup!<br clear="all"><div><div dir="ltr" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>+Chris<br></div></div></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 9, 2020 at 12:57 AM Rob Landley <<a href="mailto:rob@landley.net" target="_blank">rob@landley.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
On 9/9/20 12:30 AM, Rob Landley wrote:<br>
> On 9/8/20 2:16 PM, Chris Sarra via Toybox wrote:<br>
>> ---<br>
>>  toys/posix/logger.c | 7 ++++---<br>
>>  1 file changed, 4 insertions(+), 3 deletions(-)<br>
>><br>
>> diff --git a/toys/posix/logger.c b/toys/posix/logger.c<br>
>> index 3bcfb174..d1cc7291 100644<br>
>> --- a/toys/posix/logger.c<br>
>> +++ b/toys/posix/logger.c<br>
>> @@ -64,9 +64,10 @@ void logger_main(void)<br>
>>      else {<br>
>>        *s1++ = len = 0;<br>
>>        facility = arrayfind(TT.p, facilities, ARRAY_LEN(facilities));<br>
>> -      if (facility == -1 && strncasecmp(TT.p, "local", 5)) {<br>
>> -        facility = s1[5]-'0';<br>
>> -        if (facility>7 || s1[6]) facility = -1;<br>
>> +      if (facility == -1 && strncasecmp(TT.p, "local", 5) == 0) {<br>
>> +        s2 = TT.p;<br>
>> +        facility = s2[5]-'0';<br>
>> +        if (facility>7 || s2[6]) facility = -1;<br>
> <br>
> Sigh, why did I promote this out of pending? arrayfind() initializes matchlen to<br>
> 0 and then never sets it to anything ELSE, so it ONLY returns exact matches not<br>
> longest unambiguous match (which is the point of the function I think?)<br>
> <br>
> Applied your patch, but I have some cleanup to do to this command...<br>
<br>
I did the cleanup but I have no tests/logger.test, so I dunno if I broke it. (It<br>
survived obvious smoketesting, but...?)<br>
<br>
Could you try the attached and see if it works for you?<br>
<br>
Thanks,<br>
<br>
Rob<br>
</blockquote></div>