aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2021-04-06 13:44:36 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2021-04-11 00:18:56 +0200
commit99fb5f2144fc30337ec2ece3d1f59ba92ebed5fb (patch)
tree5442b4e224d5c01f3d283285b7563efed36601f4
parent6220b4d531a64825eb9698e98afa6be2d92abd8d (diff)
downloadbusybox-w32-99fb5f2144fc30337ec2ece3d1f59ba92ebed5fb.tar.gz
busybox-w32-99fb5f2144fc30337ec2ece3d1f59ba92ebed5fb.tar.bz2
busybox-w32-99fb5f2144fc30337ec2ece3d1f59ba92ebed5fb.zip
vi: issue a warning on failure to find a character
When a search for a character within a line fails issue a warning. function old new delta ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/0 up/down: 0/0) Total: 0 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--editors/vi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/editors/vi.c b/editors/vi.c
index 4fda6aebf..96e6af318 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -1809,8 +1809,10 @@ static void dot_to_char(int cmd)
1809 do { 1809 do {
1810 do { 1810 do {
1811 q += dir; 1811 q += dir;
1812 if ((dir == FORWARD ? q > end - 1 : q < text) || *q == '\n') 1812 if ((dir == FORWARD ? q > end - 1 : q < text) || *q == '\n') {
1813 indicate_error();
1813 return; 1814 return;
1815 }
1814 } while (*q != last_search_char); 1816 } while (*q != last_search_char);
1815 } while (--cmdcnt > 0); 1817 } while (--cmdcnt > 0);
1816 1818