Commit 0d200918 authored by gi1242's avatar gi1242

Segfault fix (Patch due to [email protected]).

Steps to reproduce:

    1. Generate more than "Mrxvt.saveLines" lines of output (eg, "for ((i=0; i
       <30000; i=i+1)); do echo $i; done")
    2. Scroll all the way back up to the top (shift+PgUp) and LEFT-click once.
    3. Press up arrow and hit Enter (ie, repeat step 1).
    4. Scroll all the way back up to the top (shift+PgUp) and RIGHT-click once.
    5. When running with -cf /dev/null, then step 4 usually did not cause a seg
       fault on the first try. So I would LEFT-click once and then repeat steps

    The seg fault usually happens after doing this a few times.
parent ca32cd67
......@@ -974,6 +974,13 @@ rxvt_scroll_text(rxvt_t* r, int page, int row1, int row2, int count, int spec)
SEL(r).beg.row -= count;
SEL(r).end.row -= count;
SEL(r).mark.row -= count;
if (SEL(r).mark.row < -SVLINES)
SEL(r).mark.row = -SVLINES;
if (SEL(r).beg.row < -SVLINES)
SEL(r).beg.row = -SVLINES;
if (SEL(r).end.row < -SVLINES)
SEL(r).end.row = -SVLINES;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment