From f699240426dd0a9e2aed3b9c3f2006fe615f34e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Sun, 1 Dec 2024 19:25:26 +0100 Subject: [PATCH] less: gcc2 build fix --- sys-apps/less/less-668.recipe | 1 + sys-apps/less/patches/less-668.patchset | 95 ++++++++++++++++++++++++- 2 files changed, 95 insertions(+), 1 deletion(-) diff --git a/sys-apps/less/less-668.recipe b/sys-apps/less/less-668.recipe index e8d17c8dd..654a64bf4 100644 --- a/sys-apps/less/less-668.recipe +++ b/sys-apps/less/less-668.recipe @@ -47,6 +47,7 @@ BUILD_PREREQUIRES=" BUILD() { autoconf + export CFLAGS="-std=gnu89 -Wdeclaration-after-statement" runConfigure ./configure --with-editor=nano \ --sysconfdir="$settingsDir/etc" make diff --git a/sys-apps/less/patches/less-668.patchset b/sys-apps/less/patches/less-668.patchset index 299a52923..181505af3 100644 --- a/sys-apps/less/patches/less-668.patchset +++ b/sys-apps/less/patches/less-668.patchset @@ -1,4 +1,4 @@ -From 1d5fdb8caaa69b2f09eb4dc3aed29fb27d180813 Mon Sep 17 00:00:00 2001 +From 75eebdefd18dfb1c8c962fd51bfb12e9f241fc78 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Thu, 29 Jun 2017 17:06:55 +0200 Subject: import fix from previous version @@ -133,3 +133,96 @@ index 7f92522..502cdc9 100644 -- 2.45.2 + +From d8c946c33d05e9cc3ef439b8a436f5d7ce5ccf2b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= +Date: Sun, 1 Dec 2024 19:24:35 +0100 +Subject: gcc2 build fix + + +diff --git a/decode.c b/decode.c +index 71b7118..bc80d54 100644 +--- a/decode.c ++++ b/decode.c +@@ -1004,9 +1004,10 @@ public int lesskey(constant char *filename, lbool sysvar) + static int lesskey_text(constant char *filename, lbool sysvar, lbool content) + { + static struct lesskey_tables tables; ++ int r; + if (!secure_allow(SF_LESSKEY)) + return (1); +- int r = content ? parse_lesskey_content(filename, &tables) : parse_lesskey(filename, &tables); ++ r = content ? parse_lesskey_content(filename, &tables) : parse_lesskey(filename, &tables); + if (r != 0) + return (r); + add_fcmd_table(tables.cmdtable.buf.data, tables.cmdtable.buf.end); +@@ -1080,8 +1081,8 @@ static int add_hometable(int (*call_lesskey)(constant char *, lbool), constant c + */ + static void add_content_table(int (*call_lesskey)(constant char *, lbool), constant char *envname, lbool sysvar) + { +- (void) call_lesskey; /* not used */ + constant char *content = lgetenv(envname); ++ (void) call_lesskey; /* not used */ + if (isnullenv(content)) + return; + lesskey_content(content, sysvar); +diff --git a/forwback.c b/forwback.c +index b0efc47..06bdebb 100644 +--- a/forwback.c ++++ b/forwback.c +@@ -53,11 +53,13 @@ public void eof_bell(void) + if (no_eof_bell) + return; + #if HAVE_TIME ++{ + static time_type last_eof_bell = 0; + time_type now = get_time(); + if (now == last_eof_bell) /* max once per second */ + return; + last_eof_bell = now; ++} + #endif + if (quiet == NOT_QUIET) + bell(); +diff --git a/line.c b/line.c +index 6506c05..48f18be 100644 +--- a/line.c ++++ b/line.c +@@ -1371,9 +1371,11 @@ static void col_vs_pos(POSITION linepos, mutable struct col_pos *cp, POSITION sa + utf8_buf[utf8_len++] = ch; + if (is_utf8_well_formed(utf8_buf, utf8_len)) + { +- LWCHAR wch = get_wchar(utf8_buf); ++ int attr; ++ LWCHAR wch; + utf8_len = 0; +- int attr = 0; /* {{ ignoring attribute is not correct for magic cookie terminals }} */ ++ attr = 0; /* {{ ignoring attribute is not correct for magic cookie terminals }} */ ++ wch = get_wchar(utf8_buf); + if (utf_mode && ctldisp != OPT_ON && is_ubin_char(wch)) + cw = strlen(prutfchar(wch)); + else +diff --git a/search.c b/search.c +index a8142ea..de66ced 100644 +--- a/search.c ++++ b/search.c +@@ -1264,12 +1264,14 @@ struct osc8_parse_info { + static lbool osc8_parse(constant char *line, constant char *line_end, struct osc8_parse_info *pop) + { + constant char *oline; ++ LWCHAR ch; ++ struct ansi_state *pansi; + pop->osc8_start = pop->osc8_end = pop->uri_start = pop->uri_end = pop->params_start = pop->params_end = NULL; + + oline = line; +- LWCHAR ch = step_charc(&line, +1, line_end); ++ ch = step_charc(&line, +1, line_end); + /* oline points to character ch, line points to the one after it. */ +- struct ansi_state *pansi = ansi_start(ch); ++ pansi = ansi_start(ch); + if (pansi == NULL) + return FALSE; + pop->osc8_start = oline; /* start at the ESC */ +-- +2.45.2 +