1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-29 04:45:57 -04: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;
unichar *ptr = (unichar *) paste_buffer->data;
if (len <= 0) {
if (len < 0) {
return;
}
@ -702,10 +702,8 @@ static void paste_bracketed_middle()
len -= marklen * 2;
/* go one step back */
if (i > 0) {
i--;
ptr--;
}
i--;
ptr--;
continue;
}
paste_bracketed_end(i, i != len);