Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'editors')
-rw-r--r--editors/vi.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/editors/vi.c b/editors/vi.c
index 508477954..eee5e0ed2 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -2527,8 +2527,13 @@ static char *get_one_address(char *p, int *result) // get colon addr, if present
dir = ((unsigned)BACK << 1) | FULL;
}
q = char_search(q, last_search_pattern + 1, dir);
- if (q == NULL)
- return NULL;
+ if (q == NULL) {
+ // no match, continue from other end of file
+ q = char_search(dir > 0 ? text : end - 1,
+ last_search_pattern + 1, dir);
+ if (q == NULL)
+ return NULL;
+ }
new_addr = count_lines(text, q);
}
# endif