Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [BUG] SIGSEGV under certain circumstances



On Sun, Mar 5, 2017 at 2:51 PM, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Sun, Mar 5, 2017 at 2:41 PM, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
>>
>> The part that confuses me is why the line says 'mp += cl' rather than
>> simply 'mp++'.  The inner loop executes precisely 'zl' times (because
>> the loop variable, 'tl', is initialized to 'al' and skips Meta bytes),
>> and 'mp' points into an array of size 'zl'.
>
> Yes, that's the part that confuses me as well, i.e., why is mb
> incremented once for every byte rather than once for every character?

Also, it seems to me cl needs to be the number of bytes compared by
pattern_match(), which is not always just 1 or 2 with wide characters.



Messages sorted by: Reverse Date, Date, Thread, Author