2008-10-29 13:46:28 +00:00
|
|
|
--- a/editors/vi.c
|
|
|
|
+++ b/editors/vi.c
|
2009-02-21 15:07:45 +00:00
|
|
|
@@ -3313,7 +3313,7 @@ static void do_cmd(char c)
|
2008-10-29 13:46:28 +00:00
|
|
|
buf[1] = '\0';
|
|
|
|
q = get_input_line(buf); // get input line- use "status line"
|
|
|
|
if (q[0] && !q[1]) {
|
|
|
|
- if (last_search_pattern[0])
|
|
|
|
+ if (last_search_pattern)
|
|
|
|
last_search_pattern[0] = c;
|
|
|
|
goto dc3; // if no pat re-use old pat
|
|
|
|
}
|
2009-02-21 15:07:45 +00:00
|
|
|
@@ -3329,6 +3329,10 @@ static void do_cmd(char c)
|
2008-10-29 13:46:28 +00:00
|
|
|
if (cmdcnt-- > 1) {
|
|
|
|
do_cmd(c);
|
|
|
|
} // repeat cnt
|
|
|
|
+ if (last_search_pattern == 0) {
|
|
|
|
+ msg = "No previous regular expression";
|
|
|
|
+ goto dc2;
|
|
|
|
+ }
|
|
|
|
dir = BACK; // assume BACKWARD search
|
|
|
|
p = dot - 1;
|
|
|
|
if (last_search_pattern[0] == '?') {
|
2009-02-21 15:07:45 +00:00
|
|
|
@@ -3348,10 +3352,8 @@ static void do_cmd(char c)
|
2008-10-29 13:46:28 +00:00
|
|
|
msg = "No previous regular expression";
|
|
|
|
goto dc2;
|
|
|
|
}
|
|
|
|
- if (last_search_pattern[0] == '/') {
|
|
|
|
- dir = FORWARD; // assume FORWARD search
|
|
|
|
- p = dot + 1;
|
|
|
|
- }
|
|
|
|
+ dir = FORWARD; // assume FORWARD search
|
|
|
|
+ p = dot + 1;
|
|
|
|
if (last_search_pattern[0] == '?') {
|
|
|
|
dir = BACK;
|
|
|
|
p = dot - 1;
|