| Summary: | vi: fix end key "lock" which require Ctrl+c | ||
|---|---|---|---|
| Product: | Busybox | Reporter: | Tanguy Pruvot <tanguy.pruvot> |
| Component: | Other | Assignee: | unassigned |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | busybox-cvs, tanguy.pruvot |
| Priority: | P5 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
|
Description
Tanguy Pruvot
2011-11-23 22:20:28 UTC
sorry, was already fixed :p *** This bug has been marked as a duplicate of bug 4153 *** diff --git a/editors/vi.c b/editors/vi.c
index 71d6008..8a28212 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -3069,9 +3069,8 @@ static void do_cmd(int c)
int cnt, i, j;
int c1;
-// c1 = c; // quiet the compiler
-// cnt = yf = 0; // quiet the compiler
-// p = q = save_dot = buf; // quiet the compiler
+ c1 = cnt = 0;
+ p = q = save_dot = NULL;
memset(buf, '\0', sizeof(buf));
show_status_line();
@@ -3317,12 +3316,19 @@ static void do_cmd(int c)
#endif /* FEATURE_VI_YANKMARK */
case '$': // $- goto end of line
case KEYCODE_END: // Cursor Key End
+ if (--cmdcnt > 0) {
+ dot_next();
+ do_cmd(c);
+ }
+ dot = end_line(dot);
+/*
for (;;) {
dot = end_line(dot);
if (--cmdcnt > 0)
break;
dot_next();
}
+*/
break;
case '%': // %- find matching char of pair () [] {}
for (q = dot; q < end && *q != '\n'; q++) {
The fix is simple: if (--cmdcnt > 0) condition should be reversed: f (--cmdcnt <= 0) Fixed in git. |