1
0
mirror of https://github.com/irssi/irssi.git synced 2025-02-02 15:08:01 -05:00

Handle empty bracketed pastes (or sequences of those)

Both cases were off-by-one mistakes erring on the side of being too
conservative. This fixes these two harmless issues:

- For a single empty paste, it required another keystroke before
  processing it
- For a sequence of themcase, a single '~' was left in the input
This commit is contained in:
dequis 2015-09-25 03:22:02 -03:00
parent c721d57688
commit 7866d2bcd6

View File

@ -685,7 +685,7 @@ static void paste_bracketed_middle()
int len = paste_buffer->len - marklen; int len = paste_buffer->len - marklen;
unichar *ptr = (unichar *) paste_buffer->data; unichar *ptr = (unichar *) paste_buffer->data;
if (len <= 0) { if (len < 0) {
return; return;
} }
@ -702,10 +702,8 @@ static void paste_bracketed_middle()
len -= marklen * 2; len -= marklen * 2;
/* go one step back */ /* go one step back */
if (i > 0) { i--;
i--; ptr--;
ptr--;
}
continue; continue;
} }
paste_bracketed_end(i, i != len); paste_bracketed_end(i, i != len);