[Toybox] grep -A/B/C doesn't respect -n

enh enh at google.com
Mon Feb 8 13:21:55 PST 2016


works for me on Android, though you might be interested to know it
doesn't work on glibc 2.19 --- looks like their printf can't cope with
INT_MAX. making that (INT_MAX/2) worked for me. but presumably you're
running a newer glibc that has this bug fixed, so it doesn't matter?

On Thu, Feb 4, 2016 at 3:52 PM, Rob Landley <rob at landley.net> wrote:
> On 02/02/2016 08:53 PM, enh wrote:
>> i had a quick play with the new -A/B/C and noticed that toybox doesn't
>> respect -n for the context lines. should look something like:
>>
>> ~$ grep -n -C1 CPU /proc/cpuinfo
>> 4-model : 69
>> 5:model name : Intel(R) Core(TM) i7-4600U CPU @ 2.10GHz
>> 6-stepping : 1
>> ...
>>
>> but actually looks like this:
>>
>> $ ./toybox grep -n -C1 CPU /proc/cpuinfo
>> 5:model : 69
>> model name : Intel(R) Core(TM) i7-4600U CPU @ 2.10GHz
>> stepping : 1
>>
>> (note also that for the line that _does_ get the -n prefix, there
>> should be a - rather than a : on non-matching context lines.)
>
> Sigh. I fixed one issue on this machine, pushed it, fixed the other on
> the other machine, accidentlly committed and pulled, and it added a
> merge commit I didn't notice until after I pushed.
>
> I need a way to tell git "if you can't do a fast forward, FAIL". If get
> reset HEAD^1 doesn't fix it I will #*%(&# clone a fresh repo and get
> format-patch and git am the patches over until I have a clean history.
>
> Blah.
>
> Anyway, should be fixed in the repo now. Right after a giant pointless
> wart of a merge commit that merged branches that DIDN'T TOUCH THE SAME
> #*(%&# FILES EVEN ONCE.
>
> I hate git,
>
> Rob



-- 
Elliott Hughes - http://who/enh - http://jessies.org/~enh/
Android native code/tools questions? Mail me/drop by/add me as a reviewer.

 1454966515.0


More information about the Toybox mailing list