aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Fox <pgf@brightstareng.com>2008-03-05 16:44:02 +0000
committerPaul Fox <pgf@brightstareng.com>2008-03-05 16:44:02 +0000
commit4917c11432c06ae4119c8cea6964cdf431ec6ac5 (patch)
treed58dc0b853fbf3a00cdeb430151182eac407a011
parenta43dba76ea394d789de67c6322b51e1d65bdba3b (diff)
downloadbusybox-w32-4917c11432c06ae4119c8cea6964cdf431ec6ac5.tar.gz
busybox-w32-4917c11432c06ae4119c8cea6964cdf431ec6ac5.tar.bz2
busybox-w32-4917c11432c06ae4119c8cea6964cdf431ec6ac5.zip
fix vi's '?' and '/' commands to correctly set a new direction
when reusing a previous search pattern. previously only 'n' and 'N' reversed directions properly.
-rw-r--r--editors/vi.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/editors/vi.c b/editors/vi.c
index d2d267036..31ad96c02 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -3293,8 +3293,11 @@ static void do_cmd(char c)
3293 buf[0] = c; 3293 buf[0] = c;
3294 buf[1] = '\0'; 3294 buf[1] = '\0';
3295 q = get_input_line(buf); // get input line- use "status line" 3295 q = get_input_line(buf); // get input line- use "status line"
3296 if (q[0] && !q[1]) 3296 if (q[0] && !q[1]) {
3297 if (last_search_pattern[0])
3298 last_search_pattern[0] = c;
3297 goto dc3; // if no pat re-use old pat 3299 goto dc3; // if no pat re-use old pat
3300 }
3298 if (q[0]) { // strlen(q) > 1: new pat- save it and find 3301 if (q[0]) { // strlen(q) > 1: new pat- save it and find
3299 // there is a new pat 3302 // there is a new pat
3300 free(last_search_pattern); 3303 free(last_search_pattern);