summaryrefslogtreecommitdiff
path: root/text.c
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2023-04-27 15:33:37 -0400
committerChet Ramey <chet.ramey@case.edu>2023-04-27 15:33:37 -0400
commitf156385efb545a5ab96a2461555955d7f280aac4 (patch)
tree4c4ede0b0755f46629e1076b884ccf03654f5d47 /text.c
parent14144013617be12f94b99b05bf0928a8d1eba743 (diff)
downloadreadline-f156385efb545a5ab96a2461555955d7f280aac4.tar.gz
asan updates to non-incremental search, redisplay; rework non-incremental search to avoid pointer aliasing issuesdevel
Diffstat (limited to 'text.c')
-rw-r--r--text.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/text.c b/text.c
index 62e4da2..356cac5 100644
--- a/text.c
+++ b/text.c
@@ -1229,11 +1229,12 @@ _rl_rubout_char (int count, int key)
c = rl_line_buffer[--rl_point];
rl_delete_text (rl_point, orig_point);
/* The erase-at-end-of-line hack is of questionable merit now. */
- if (rl_point == rl_end && ISPRINT ((unsigned char)c) && _rl_last_c_pos)
+ if (rl_point == rl_end && ISPRINT ((unsigned char)c) && _rl_last_c_pos && _rl_last_v_pos == 0)
{
int l;
l = rl_character_len (c, rl_point);
- _rl_erase_at_end_of_line (l);
+ if (_rl_last_c_pos >= l)
+ _rl_erase_at_end_of_line (l);
}
}
else