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 <[email protected]>
---
 editors/vi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/editors/vi.c b/editors/vi.c
index 5d67983e1..e48ad68c7 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -1840,8 +1840,10 @@ static void dot_to_char(int cmd)
        do {
                do {
                        q += dir;
-                       if ((dir == FORWARD ? q > end - 1 : q < text) || *q == 
'\n')
+                       if ((dir == FORWARD ? q > end - 1 : q < text) || *q == 
'\n') {
+                               indicate_error();
                                return;
+                       }
                } while (*q != last_search_char);
        } while (--cmdcnt > 0);
 
-- 
2.30.2

_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to