ports/editors/nvi2/files/patch-common_options.c
Craig Leres ab0fed1b91 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
2025-01-14 13:01:28 -08:00

20 lines
778 B
C

--- 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; \