From nobody Tue Jan 14 21:01:53 2025 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXhQB4T6pz5kQnv; Tue, 14 Jan 2025 21:01:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXhQB00Spz4Mvy; Tue, 14 Jan 2025 21:01:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736888514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OMkH8qBbUqcO9XvYOY2ZwvKT6FNDm5fJfrUCLAOGxL0=; b=m9mqIIi3ZUd0rznBaqK8vJ5M22Z+g1BDd/Ot77ziE4gggpdMdhDCr4loYZQGkvPV2Eohxw 6K5WSN/TGlGZ+jfXLJkuL3tEm3tnjG451GD4g/FTbys2hggeQEr1i2BiXfWA1jrE82/+IP 91iM5OJoxiA44zqiFkQqLignemgsnpQ+h2ULAJ+Djh79pFH2VW4pyTewO11OZexQ+jr4kI Ztu1GnnHW95cJqlXfugkQWFPObSlgJKVTIW/a9Qe1vOQEGVDBQ94IWx5nKjeEQIkvVD6CR plkmdKOlljaQqDliRE5ZkIgcrt496gVDjaUPou1rYuAavQhBDlw7O61rstQsnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736888514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OMkH8qBbUqcO9XvYOY2ZwvKT6FNDm5fJfrUCLAOGxL0=; b=U6d1iTERIfnGsMC/hTWmetmV/HiDsH5Ccu8RU/eEp8f1YizkXOnhz4f2GgPUpIRLzJGRsq nEtlvEyUil4arKw6QJXSdN2RX8HeDios6qlvniMRlijIxgC/e7anU2O+mZurg8UZ7ifbmZ /cHJs8Ek++MQ+S4N7N/OTxaQY90YCxRl4YvxLDmU651A1zcD8zU3Cn/ggpTdoAIDdmp+bC mbvZaILwkiywGm0KBNTD4KsTvo1fhIPT4Pc9RfFra0/yZLJ9RJlJIDpv+GcnrlxYaUzQ5E W0Fc5OErneYKTFMm4scRXKwt8Ja931CPC8te/ZzSF/Se9Cq5Ow0uBKukbhQfRQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736888514; a=rsa-sha256; cv=none; b=ed+lmm4tgig/uj/WWWNh6tC5Z97UVnhtnNpXsy853d+V7Q4LKA0B7i7yc75qkb96ja0fiO 1QidDzO/OEoHhkZYEkD+uwuGAKJyub9tGtIaJF26iR8ZAghEzJkUPXPTrtv55xCAb4lpn2 YDVtnPdcEDwbj9ORxCWpLePEmV/x+pPq3levRn9mVoJXJ7PEyJPUHPeD3CeX3lotWML//n uWSUTWhH9JNBy//TYqbEbcJ4JxGA0rbgHj1SRcwF24K0TbjF0bkwOesvADDNp9EhXJdY6l t/KRnnuOC7WvtkGTRnaes0Ew60xutuIMHGfrM1Lr+Y35AvrDER2MSYQx5b7w3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXhQ96ZdCz2Gb; Tue, 14 Jan 2025 21:01:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50EL1rpc027502; Tue, 14 Jan 2025 21:01:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EL1rq1027499; Tue, 14 Jan 2025 21:01:53 GMT (envelope-from git) Date: Tue, 14 Jan 2025 21:01:53 GMT Message-Id: <202501142101.50EL1rq1027499@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Craig Leres Subject: git: ab0fed1b910a - main - editors/nvi2: Update to 26-Apr-2024 (52c07e8) List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-all@freebsd.org Sender: owner-dev-commits-ports-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: leres X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ab0fed1b910aa3192a3702f1361a98b706f2bacb Auto-Submitted: auto-generated The branch main has been updated by leres: URL: https://cgit.FreeBSD.org/ports/commit/?id=ab0fed1b910aa3192a3702f1361a98b706f2bacb commit ab0fed1b910aa3192a3702f1361a98b706f2bacb Author: Craig Leres AuthorDate: 2025-01-14 21:01:28 +0000 Commit: Craig Leres CommitDate: 2025-01-14 21:01:28 +0000 editors/nvi2: Update to 26-Apr-2024 (52c07e8) - In ruler show the current line number as a percentage of the total lines - Link macro for hyperlink - Add showfilename set option - Fix undefined string comparison - Replace Clang-only __builtin_is_aligned with C code - Use memmove to realign buffers --- editors/nvi2/Makefile | 2 +- editors/nvi2/files/patch-CMakeLists.txt | 10 ++ editors/nvi2/files/patch-common_common.h | 10 ++ editors/nvi2/files/patch-common_log.c | 46 +++++++++ editors/nvi2/files/patch-common_mem.h | 21 ++++ editors/nvi2/files/patch-common_options.c | 20 ++++ editors/nvi2/files/patch-man_vi.1 | 154 ++++++++++++++++++++++++++++++ editors/nvi2/files/patch-vi_vs__refresh.c | 38 ++++++++ 8 files changed, 300 insertions(+), 1 deletion(-) diff --git a/editors/nvi2/Makefile b/editors/nvi2/Makefile index d049021e91de..52a484c9a8c9 100644 --- a/editors/nvi2/Makefile +++ b/editors/nvi2/Makefile @@ -1,6 +1,6 @@ PORTNAME= nvi2 PORTVERSION= 2.2.1 -PORTREVISION= 2 +PORTREVISION= 3 DISTVERSIONPREFIX= v CATEGORIES= editors diff --git a/editors/nvi2/files/patch-CMakeLists.txt b/editors/nvi2/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..c84550ec0002 --- /dev/null +++ b/editors/nvi2/files/patch-CMakeLists.txt @@ -0,0 +1,10 @@ +--- CMakeLists.txt.orig 2023-09-25 08:47:42 UTC ++++ CMakeLists.txt +@@ -37,7 +37,6 @@ add_compile_options($<$:-Wno-dangling- + endif() + add_compile_options($<$:-Wuninitialized>) + add_compile_options($<$:-Wno-dangling-else>) +-add_compile_options(-Wno-string-compare) + add_compile_options(-Wstack-protector -fstack-protector) + add_compile_options(-Wstrict-aliasing -fstrict-aliasing) + diff --git a/editors/nvi2/files/patch-common_common.h b/editors/nvi2/files/patch-common_common.h new file mode 100644 index 000000000000..86572d78dc07 --- /dev/null +++ b/editors/nvi2/files/patch-common_common.h @@ -0,0 +1,10 @@ +--- common/common.h.orig 2023-09-25 08:47:42 UTC ++++ common/common.h +@@ -17,6 +17,7 @@ + #include + #endif + #include /* May refer to the bundled regex. */ ++#include + + /* + * Forward structure declarations. Not pretty, but the include files diff --git a/editors/nvi2/files/patch-common_log.c b/editors/nvi2/files/patch-common_log.c new file mode 100644 index 000000000000..f46178eb34eb --- /dev/null +++ b/editors/nvi2/files/patch-common_log.c @@ -0,0 +1,46 @@ +--- common/log.c.orig 2023-09-25 08:47:42 UTC ++++ common/log.c +@@ -18,7 +18,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -706,30 +705,18 @@ apply_with(int (*db_func)(SCR *, recno_t, CHAR_T *, si + recno_t lno, u_char *p, size_t len) + { + #ifdef USE_WIDECHAR +- typedef unsigned long nword; +- + static size_t blen; +- static nword *bp; +- nword *lp = (nword *)((uintptr_t)p / sizeof(nword) * sizeof(nword)); ++ static u_char *bp; + +- if (lp != (nword *)p) { +- int offl = ((uintptr_t)p - (uintptr_t)lp) << 3; +- int offr = (sizeof(nword) << 3) - offl; +- size_t i, cnt = (len + sizeof(nword) / 2) / sizeof(nword); +- ++ if (!is_aligned(p, sizeof(unsigned long))) { + if (len > blen) { + blen = p2roundup(MAX(len, 512)); +- REALLOC(sp, bp, nword *, blen); ++ REALLOC(sp, bp, u_char *, blen); + if (bp == NULL) + return (1); + } +- for (i = 0; i < cnt; ++i) +-#if BYTE_ORDER == BIG_ENDIAN +- bp[i] = (lp[i] << offl) ^ (lp[i+1] >> offr); +-#else +- bp[i] = (lp[i] >> offl) ^ (lp[i+1] << offr); +-#endif +- p = (u_char *)bp; ++ memmove(bp, p, len); ++ p = bp; + } + #endif + return db_func(sp, lno, (CHAR_T *)p, len / sizeof(CHAR_T)); diff --git a/editors/nvi2/files/patch-common_mem.h b/editors/nvi2/files/patch-common_mem.h new file mode 100644 index 000000000000..9b18726f8696 --- /dev/null +++ b/editors/nvi2/files/patch-common_mem.h @@ -0,0 +1,21 @@ +--- common/mem.h.orig 2023-09-25 08:47:42 UTC ++++ common/mem.h +@@ -212,6 +212,18 @@ p2roundup(size_t n) + return (n); + } + ++/* ++ * is_aligned -- ++ * Determine whether the program can safely read an object with an ++ * alignment requirement from ptr. ++ * ++ * See also: https://clang.llvm.org/docs/LanguageExtensions.html#alignment-builtins ++ */ ++static __inline int ++is_aligned(void *ptr, size_t alignment) { ++ return ((uintptr_t)ptr % alignment) == 0; ++} ++ + /* Additional TAILQ helper. */ + #define TAILQ_ENTRY_ISVALID(elm, field) \ + ((elm)->field.tqe_prev != NULL) diff --git a/editors/nvi2/files/patch-common_options.c b/editors/nvi2/files/patch-common_options.c new file mode 100644 index 000000000000..9a9bb8ce3ad6 --- /dev/null +++ b/editors/nvi2/files/patch-common_options.c @@ -0,0 +1,20 @@ +--- common/options.c.orig 2023-09-25 08:47:42 UTC ++++ common/options.c +@@ -181,6 +181,8 @@ OPTLIST const optlist[] = { + {L("shellmeta"), NULL, OPT_STR, 0}, + /* O_SHIFTWIDTH 4BSD */ + {L("shiftwidth"), NULL, OPT_NUM, OPT_NOZERO}, ++/* O_SHOWFILENAME */ ++ {L("showfilename"), NULL, OPT_0BOOL, 0}, + /* O_SHOWMATCH 4BSD */ + {L("showmatch"), NULL, OPT_0BOOL, 0}, + /* O_SHOWMODE 4.4BSD */ +@@ -317,7 +319,7 @@ opts_init(SCR *sp, int *oargs) + /* Set numeric and string default values. */ + #define OI(indx, str) do { \ + a.len = STRLEN(str); \ +- if ((CHAR_T*)str != b2) /* GCC puts strings in text-space. */ \ ++ if (STRCMP((CHAR_T*)str, b2) != 0) \ + (void)MEMCPY(b2, str, a.len+1); \ + if (opts_set(sp, argv, NULL)) { \ + optindx = indx; \ diff --git a/editors/nvi2/files/patch-man_vi.1 b/editors/nvi2/files/patch-man_vi.1 new file mode 100644 index 000000000000..7c62d402de6c --- /dev/null +++ b/editors/nvi2/files/patch-man_vi.1 @@ -0,0 +1,154 @@ +--- man/vi.1.orig 2023-09-25 08:47:42 UTC ++++ man/vi.1 +@@ -12,11 +12,13 @@ + .\" that you would have purchased it, or if any company wishes to + .\" redistribute it, contributions to the authors would be appreciated. + .\" +-.Dd November 2, 2013 ++.Dd April 18, 2024 + .Dt VI 1 + .Os + .Sh NAME +-.Nm ex , vi , view ++.Nm ex , ++.Nm vi , ++.Nm view + .Nd text editors + .Sh SYNOPSIS + .Nm ex +@@ -302,7 +304,7 @@ will refuse to quit). + (if you've modified the file, but not saved your changes, + .Nm vi + will refuse to quit). +-.It Cm :q! ++.It Cm :q\&! + Quit, discarding any modifications that you may have made. + .El + .Pp +@@ -706,7 +708,7 @@ command being entered, or cancel it if it is only part + .Nm ex + command being entered, or cancel it if it is only partial. + .Pp +-.It Aq Cm control-] ++.It Aq Cm control-\(rB + Push a tag reference onto the tag stack. + .Pp + .It Aq Cm control-\(ha +@@ -830,7 +832,7 @@ to the position of the cursor before the last of the f + to the position of the cursor before the last of the following commands: + .Aq Cm control-A , + .Aq Cm control-T , +-.Aq Cm control-] , ++.Aq Cm control-\(rB , + .Cm % , + .Cm \(aq , + .Cm \` , +@@ -1809,8 +1811,8 @@ Display buffers, Cscope connections, screens or tags. + .Op Ar +cmd + .Op Ar file + .Xc +-Edit a different file. The capitalized command opens a new screen below the +-current screen. ++Edit a different file. ++The capitalized command opens a new screen below the current screen. + .Pp + .It Xo + .Cm exu Ns Op Cm sage +@@ -1833,8 +1835,8 @@ mode only. + .Xc + .Nm vi + mode only. +-Foreground the specified screen. The capitalized command opens a new screen +-below the current screen. ++Foreground the specified screen. ++The capitalized command opens a new screen below the current screen. + .Pp + .It Xo + .Op Ar range +@@ -1921,8 +1923,8 @@ Write the abbreviations, editor options and maps to th + .Op Cm !\& + .Op Ar + .Xc +-Edit the next file from the argument list. The capitalized command opens a +-new screen below the current screen. ++Edit the next file from the argument list. ++The capitalized command opens a new screen below the current screen. + .\" .Pp + .\" .It Xo + .\" .Op Ar line +@@ -1943,8 +1945,8 @@ option. + .Cm rev Ns Op Cm ious Ns + .Op Cm !\& + .Xc +-Edit the previous file from the argument list. The capitalized command opens +-a new screen below the current screen. ++Edit the previous file from the argument list. ++The capitalized command opens a new screen below the current screen. + .Pp + .It Xo + .Op Ar range +@@ -2107,8 +2109,8 @@ character is usually + .Op Cm !\& + .Ar tagstring + .Xc +-Edit the file containing the specified tag. The capitalized command opens a +-new screen below the current screen. ++Edit the file containing the specified tag. ++The capitalized command opens a new screen below the current screen. + .Pp + .It Xo + .Cm tagn Ns Op Cm ext Ns +@@ -2178,8 +2180,8 @@ Enter + .Op Ar file + .Xc + .Nm vi +-mode only. Edit a different file by opening a new screen below the current +-screen. ++mode only. ++Edit a different file by opening a new screen below the current screen. + .Pp + .It Xo + .Cm viu Ns Op Cm sage +@@ -2226,7 +2228,8 @@ overwrites a different, preexisting file. + .Sq !\& + overwrites a different, preexisting file. + .Sq >> +-appends to a file that may preexist. Whitespace followed by ++appends to a file that may preexist. ++Whitespace followed by + .Sq !\& + pipes the file to + .Ar shell-command . +@@ -2479,7 +2482,7 @@ only. + .It Cm ruler Bq off + .Nm vi + only. +-Display a row/column ruler on the colon command line. ++Display a row/column/percentage ruler on the colon command line. + .It Cm scroll , scr Bq "window size / 2" + Set the number of lines scrolled. + .It Cm searchincr Bq off +@@ -2505,6 +2508,10 @@ Set the autoindent and shift command indentation width + is necessary. + .It Cm shiftwidth , sw Bq 8 + Set the autoindent and shift command indentation width. ++.It Cm showfilename Bq off ++.Nm vi ++only. ++Display the file name on the colon command line. + .It Cm showmatch , sm Bq off + .Nm vi + only. +@@ -2773,10 +2780,8 @@ and \*(Gt0 if an error occurs. + .Xr ctags 1 , + .Xr iconv 1 , + .Xr re_format 7 +-.Rs +-.%T vi/ex reference manual +-.%U https://docs.freebsd.org/44doc/usd/13.viref/paper.pdf +-.Re ++.Pp ++.Lk https://docs.freebsd.org/44doc/usd/13.viref/paper.pdf "Vi/Ex Reference Manual" + .Sh STANDARDS + .Nm nex Ns / Ns Nm nvi + is close to diff --git a/editors/nvi2/files/patch-vi_vs__refresh.c b/editors/nvi2/files/patch-vi_vs__refresh.c new file mode 100644 index 000000000000..83f18b0333c5 --- /dev/null +++ b/editors/nvi2/files/patch-vi_vs__refresh.c @@ -0,0 +1,38 @@ +--- vi/vs_refresh.c.orig 2023-09-25 08:47:42 UTC ++++ vi/vs_refresh.c +@@ -774,7 +774,8 @@ vs_modeline(SCR *sp) + size_t cols, curcol, curlen, endpoint, len, midpoint; + const char *t = NULL; + int ellipsis; +- char buf[20]; ++ char buf[30]; ++ recno_t last; + + gp = sp->gp; + +@@ -795,7 +796,7 @@ vs_modeline(SCR *sp) + + /* If more than one screen in the display, show the file name. */ + curlen = 0; +- if (IS_SPLIT(sp)) { ++ if (IS_SPLIT(sp) || O_ISSET(sp, O_SHOWFILENAME)) { + CHAR_T *wp, *p; + size_t l; + +@@ -846,8 +847,14 @@ vs_modeline(SCR *sp) + cols = sp->cols - 1; + if (O_ISSET(sp, O_RULER)) { + vs_column(sp, &curcol); +- len = snprintf(buf, sizeof(buf), "%lu,%lu", +- (u_long)sp->lno, (u_long)(curcol + 1)); ++ ++ if (db_last(sp, &last) || last == 0) ++ len = snprintf(buf, sizeof(buf), "%lu,%zu", ++ (u_long)sp->lno, curcol + 1); ++ else ++ len = snprintf(buf, sizeof(buf), "%lu,%zu %lu%%", ++ (u_long)sp->lno, curcol + 1, ++ (u_long)(sp->lno * 100) / last); + + midpoint = (cols - ((len + 1) / 2)) / 2; + if (curlen < midpoint) {