summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2015-09-25 03:22:02 -0300
committerdequis <dx@dxzone.com.ar>2015-09-27 16:08:07 -0300
commit7866d2bcd6797b8279238ffb2f710bd9ea599cc8 (patch)
tree71da8d9d6ae3375d060f88f2b9b18e248b675d83 /src
parentc721d57688e8f5413df7c179eac54c315343fbb0 (diff)
downloadirssi-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')
-rw-r--r--src/fe-text/gui-readline.c8
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);