tvi: do not copy vi_charlast into itself in vi_findchar() - neatvi - [fork] sim… | |
git clone git://src.adamsgaard.dk/neatvi | |
Log | |
Files | |
Refs | |
README | |
--- | |
commit a361130de2e06249c9bc838a050f09333b0d762d | |
parent 54a452c55c89f3f3bc1a58741b81f2471c7a9c18 | |
Author: Ali Gholami Rudi <[email protected]> | |
Date: Wed, 3 Mar 2021 11:27:29 +0330 | |
vi: do not copy vi_charlast into itself in vi_findchar() | |
Diffstat: | |
M vi.c | 3 ++- | |
1 file changed, 2 insertions(+), 1 deletion(-) | |
--- | |
diff --git a/vi.c b/vi.c | |
t@@ -246,7 +246,8 @@ static int vi_nextcol(struct lbuf *lb, int dir, int *row, … | |
static int vi_findchar(struct lbuf *lb, char *cs, int cmd, int n, int *row, in… | |
{ | |
- strcpy(vi_charlast, cs); | |
+ if (cs != vi_charlast) | |
+ strcpy(vi_charlast, cs); | |
vi_charcmd = cmd; | |
return lbuf_findchar(lb, cs, cmd, n, row, off); | |
} |