From 874d317334fae1ddce316f9b6f4d0ce4e434bf52 Mon Sep 17 00:00:00 2001 From: Thomas Ulmer Date: Tue, 23 Jun 2026 21:34:41 -0700 Subject: heirloom vi fixes from arch AUR --- ex_vops3.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'ex_vops3.c') diff --git a/ex_vops3.c b/ex_vops3.c index a855f16..f1a1534 100644 --- a/ex_vops3.c +++ b/ex_vops3.c @@ -127,7 +127,7 @@ llfind(bool pastatom, int cnt, void (*f)(int), line *limit) */ wasend = 0; lf = f; - strcpy(save, linebuf); + lcpy(save, linebuf, LBSIZE); if (limit == 0) limit = dir < 0 ? one : dol; llimit = limit; @@ -195,7 +195,7 @@ begin: while (!endsent(pastatom)) if (!lnext()) goto ret; - if (!pastatom || wcursor == linebuf && endPS()) + if (!pastatom || (wcursor == linebuf && endPS())) if (--cnt <= 0) break; if (linebuf[0] == 0) { @@ -231,7 +231,7 @@ begin: * If we are not at a section/paragraph division, * advance to next. */ - if (wcursor == icurs && wdot == idot || wcursor != linebuf || !endPS()) + if ((wcursor == icurs && wdot == idot) || wcursor != linebuf || !endPS()) ignore(lskipa1("")); } #ifdef LISPCODE @@ -241,7 +241,7 @@ begin: * Startup by skipping if at a ( going left or a ) going * right to keep from getting stuck immediately. */ - if (dir < 0 && c == '(' || dir > 0 && c == ')') { + if ((dir < 0 && c == '(') || (dir > 0 && c == ')')) { if (!lnext()) { rc = -1; goto ret; @@ -257,7 +257,7 @@ begin: */ while (cnt > 0) { c = *wcursor; - if (dir < 0 && c == ')' || dir > 0 && c == '(') { + if ((dir < 0 && c == ')') || (dir > 0 && c == '(')) { if (!lskipbal("()")) goto ret; /* @@ -270,7 +270,7 @@ begin: if (!lnext() || !ltosolid()) goto ret; --cnt; - } else if (dir < 0 && c == '(' || dir > 0 && c == ')') + } else if ((dir < 0 && c == '(') || (dir > 0 && c == ')')) /* Found a higher level paren */ goto ret; else { @@ -297,6 +297,7 @@ endsent(bool pastatom) register char *cp = wcursor; register int c, d; + (void)pastatom; /* * If this is the beginning of a line, then * check for the end of a paragraph or section. @@ -316,7 +317,7 @@ endsent(bool pastatom) if ((d = *++cp) == 0) return (1); while (any(d, ")]'")); - if (*cp == 0 || *cp++ == ' ' && *cp == ' ') + if (*cp == 0 || (*cp++ == ' ' && *cp == ' ')) return (1); tryps: if (cp[1] == 0) @@ -430,7 +431,7 @@ lsmatch(char *cp) register char *scurs = cursor; wcursor = cp; - strcpy(sp, linebuf); + lcpy(sp, linebuf, LBSIZE); *wcursor = 0; strcpy(cursor, genbuf); cursor = strend(linebuf) - 1; @@ -588,7 +589,7 @@ lbrack(register int c, void (*f)(int)) getline(*addr); if (linebuf[0] == '{' || #ifdef LISPCODE - value(LISP) && linebuf[0] == '(' || + (value(LISP) && linebuf[0] == '(') || #endif isa(svalue(SECTIONS))) { if (c == ']' && f != vmove) { @@ -716,6 +717,7 @@ wskipright(char *line, char *pos) { int c, n; + (void)line; nextc(c, pos, n); return n; } -- cgit v1.2.3