diff options
author | dequis <dx@dxzone.com.ar> | 2015-09-25 03:22:02 -0300 |
---|---|---|
committer | dequis <dx@dxzone.com.ar> | 2015-09-27 16:08:07 -0300 |
commit | 7866d2bcd6797b8279238ffb2f710bd9ea599cc8 (patch) | |
tree | 71da8d9d6ae3375d060f88f2b9b18e248b675d83 /src/fe-text | |
parent | c721d57688e8f5413df7c179eac54c315343fbb0 (diff) | |
download | irssi-7866d2bcd6797b8279238ffb2f710bd9ea599cc8.zip |
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
Diffstat (limited to 'src/fe-text')
-rw-r--r-- | src/fe-text/gui-readline.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/fe-text/gui-readline.c b/src/fe-text/gui-readline.c index 4616e919..6e169b93 100644 --- a/src/fe-text/gui-readline.c +++ b/src/fe-text/gui-readline.c @@ -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); |