diff --git a/CHANGES b/CHANGES index ec9d2667..bb471630 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,6 @@ Changes for vile 9.9 (released ??? ??? ?? ????) - 20220820 (w) + 20220821 (w) > Brendan O'Dea: + the font specification in /etc/X11/app-defaults/UXVile was being overridden by the one in XVile. Additionally update the xvile font @@ -27,6 +27,7 @@ Changes for vile 9.9 (released ??? ??? ?? ????) + add markdown mode (mdmode). + update copyright dates + update package/freebsd/* + + fix some issues found with Coverity. + fix a few compiler-warnings. 20211212 (v) diff --git a/MANIFEST b/MANIFEST index 89947224..a0c59783 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1,4 +1,4 @@ -MANIFEST for vile, version v9_8v11 +MANIFEST for vile, version v9_8v12 -------------------------------------------------------------------------------- MANIFEST this file AUTHORS list of authors, with nicknames in CHANGES diff --git a/aclocal.m4 b/aclocal.m4 index a24b3de2..f76f93df 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,7 +1,7 @@ -dnl $Id: aclocal.m4,v 1.352 2022/08/20 19:45:31 tom Exp $ +dnl $Id: aclocal.m4,v 1.353 2022/08/21 17:11:58 tom Exp $ dnl --------------------------------------------------------------------------- dnl -dnl Copyright 1996-2020,2021 by Thomas E. Dickey +dnl Copyright 1996-2021,2022 by Thomas E. Dickey dnl dnl All Rights Reserved dnl diff --git a/display.c b/display.c index 42dd0cd3..4bcd5a25 100644 --- a/display.c +++ b/display.c @@ -4,7 +4,7 @@ * physical display screen the same as the virtual display screen. These * functions use hints that are left in the windows by the commands. * - * $Id: display.c,v 1.580 2021/05/09 21:32:16 Lois.Mansot Exp $ + * $Id: display.c,v 1.581 2022/08/21 16:24:00 tom Exp $ */ #include "estruct.h" @@ -4374,6 +4374,8 @@ hilite(int row, int colfrom, int colto, int on) #endif #ifdef WMDLINEWRAP WINDOW *wp = row2window(row); + if (wp == 0) + return; if (w_val(wp, WMDLINEWRAP)) { if (colfrom < 0) colfrom = 0; diff --git a/file.c b/file.c index 0f74d8a4..070ecf34 100644 --- a/file.c +++ b/file.c @@ -5,7 +5,7 @@ * reading and writing of the disk are * in "fileio.c". * - * $Id: file.c,v 1.463 2018/10/26 01:19:45 tom Exp $ + * $Id: file.c,v 1.465 2022/08/21 15:18:12 tom Exp $ */ #include "estruct.h" @@ -222,7 +222,7 @@ check_visible_files_changed(void) #ifdef MDCHK_MODTIME int -get_modtime(BUFFER *bp, time_t * the_time) +get_modtime(BUFFER *bp, time_t *the_time) { if (isInternalName(bp->b_fname)) *the_time = 0; @@ -315,7 +315,7 @@ CleanAfterPipe(int Wrote) */ #if SYS_UNIX && OPT_SHELL static int -slowtime(time_t * refp) +slowtime(time_t *refp) { int status = FALSE; @@ -975,7 +975,9 @@ insfile(int f GCC_UNUSED, int n GCC_UNUSED) TRACE((T_CALLED "insfile(%d, %d)\n", f, n)); - if (!calledbefore) { + if (calledbefore) { + (void) vl_strncpy(fname, tb_values(last), sizeof(fname)); + } else { if ((status = mlreply_file("Insert file: ", &last, FILEC_READ | FILEC_PROMPT, fname)) != TRUE) returnCode(status); @@ -1457,7 +1459,7 @@ quickreadf(BUFFER *bp, int *nlinep) rc = FIOMEM; } #if OPT_ENCRYPT - else if ((rc = vl_resetkey(bp, (const char *) buffer)) != TRUE) { + else if ((rc = vl_resetkey(bp, bp->b_fname)) != TRUE) { free(buffer); } #endif diff --git a/filters/spellflt.l b/filters/spellflt.l index c8a2e80e..eda3df0d 100644 --- a/filters/spellflt.l +++ b/filters/spellflt.l @@ -3,7 +3,7 @@ %{ /* - * $Id: spellflt.l,v 1.61 2019/06/23 20:28:42 tom Exp $ + * $Id: spellflt.l,v 1.62 2022/08/21 15:42:52 tom Exp $ * * Filter to add vile "attribution" sequences to misspelled words. */ @@ -341,7 +341,14 @@ do_filter(FILE *inputs GCC_UNUSED) while (len-- && isspace(CharOf(buffer[len]))) { buffer[len] = 0; } - if (*buffer) { + /* + * Ignore the word if it is all blanks, or if it contains + * wildcards which would make the insertion expand into + * multiple entries. + */ + if (len != 0 + && vl_index(buffer, zero_or_more) == 0 + && vl_index(buffer, zero_or_all) == 0) { /* * If user did not override with an entry in * spell.keywords, add the latest as a misspelled word to diff --git a/filters/vilefilt.l b/filters/vilefilt.l index c5ad5c85..c674c187 100644 --- a/filters/vilefilt.l +++ b/filters/vilefilt.l @@ -7,7 +7,7 @@ %{ /* - * $Id: vilefilt.l,v 1.75 2020/03/29 22:28:37 tom Exp $ + * $Id: vilefilt.l,v 1.76 2022/08/21 14:48:45 tom Exp $ * * Filter to add vile "attribution" sequences to selected bits of vile macros * - T.Dickey @@ -17,7 +17,7 @@ #define FLTSTACK_EXTRA int with_state; int with_active; #define FltStack_WITH_STATE FLTSTACK_THIS.with_state -#define FltStack_WITH_ACTIVE FLTSTACK_THIS.with_state +#define FltStack_WITH_ACTIVE FLTSTACK_THIS.with_active #include #if defined(_estruct_h) && !SMALLER diff --git a/history.c b/history.c index d4906913..2b4b67e0 100644 --- a/history.c +++ b/history.c @@ -55,7 +55,7 @@ * not (yet) correspond to :-commands. Before implementing, probably will * have to make TESTC a settable mode. * - * $Id: history.c,v 1.92 2015/03/13 08:52:40 tom Exp $ + * $Id: history.c,v 1.94 2022/08/21 16:46:05 tom Exp $ * */ @@ -391,8 +391,8 @@ hst_remove(const char *cmd) TRACE(("hst_remove(%s)\n", cmd)); while (*cmd++) tb_unput(MyText); - kbd_kill_response(temp, &len, killc); - tb_free(&temp); + if ((temp = kbd_kill_response(temp, &len, killc)) != 0) + tb_free(&temp); } } @@ -661,7 +661,6 @@ edithistory(TBUFF **buffer, HST param; BUFFER *bp; LINE *lp1, *lp2; - int escaped = FALSE; int c = *given; if (!isSpecial(c)) { @@ -713,20 +712,19 @@ edithistory(TBUFF **buffer, *given = c; return FALSE; - } else if ((h_direction != 0) && (escaped || !isGraph(c))) { + } else if ((h_direction != 0) && !isGraph(c)) { if ((lp2 = hst_scroll(lp1, ¶m)) != 0) lp1 = lp2; else /* cannot scroll */ kbd_alarm(); - } else if (!escaped) { + } else { *given = c; if (h_was_edited) unkeystroke(c); return h_was_edited; - } else - kbd_alarm(); + } c = keystroke(); } diff --git a/input.c b/input.c index 52a52c40..99a5e5d8 100644 --- a/input.c +++ b/input.c @@ -44,7 +44,7 @@ * tgetc_avail() true if a key is avail from tgetc() or below. * keystroke_avail() true if a key is avail from keystroke() or below. * - * $Id: input.c,v 1.373 2022/08/04 22:52:31 tom Exp $ + * $Id: input.c,v 1.374 2022/08/21 16:20:10 tom Exp $ */ #include "estruct.h" @@ -1366,7 +1366,7 @@ is_edit_char(int c) /* * Erases the response from the screen for 'kbd_string()' */ -void +TBUFF * kbd_kill_response(TBUFF *buffer, size_t *position, int c) { char *buf = tb_values(buffer); @@ -1399,6 +1399,7 @@ kbd_kill_response(TBUFF *buffer, size_t *position, int c) } tb_free(&tmp); } + return buffer; } /* diff --git a/mktbls.c b/mktbls.c index 9452bcd6..1e291f70 100644 --- a/mktbls.c +++ b/mktbls.c @@ -15,7 +15,7 @@ * by Tom Dickey, 1993. -pgf * * - * $Id: mktbls.c,v 1.203 2022/08/20 22:44:32 tom Exp $ + * $Id: mktbls.c,v 1.204 2022/08/21 14:51:39 tom Exp $ * */ @@ -2478,11 +2478,11 @@ main(int argc, char *argv[]) case SECT_VARS: if (r != 1 - || (!strcmp(vec[1], "bool") - && !strcmp(vec[1], "enum") - && !strcmp(vec[1], "int") - && !strcmp(vec[1], "string") - && !strcmp(vec[1], "regex"))) + || (strcmp(vec[1], "bool") + && strcmp(vec[1], "enum") + && strcmp(vec[1], "int") + && strcmp(vec[1], "string") + && strcmp(vec[1], "regex"))) badfmt("looking for mode datatype"); (void) my_strncpy(modetype, vec[1], sizeof(modetype)); break; diff --git a/proto.h b/proto.h index 5d2ed50d..b52219be 100644 --- a/proto.h +++ b/proto.h @@ -4,7 +4,7 @@ * * Created: Thu May 14 15:44:40 1992 * - * $Id: proto.h,v 1.754 2022/08/04 23:52:09 tom Exp $ + * $Id: proto.h,v 1.755 2022/08/21 16:20:48 tom Exp $ */ #ifndef VILE_PROTO_H @@ -776,7 +776,7 @@ extern int vl_regex2tbuff (TBUFF **buf, REGEXVAL *expr, int whole_line); extern void dotcmdstop (void); extern void get_kbd_macro (TBUFF **rp); extern void incr_dot_kregnum (void); -extern void kbd_kill_response (TBUFF *buf, size_t *position, int c); +extern TBUFF * kbd_kill_response (TBUFF *buf, size_t *position, int c); extern void kbd_mac_check (void); extern void kbd_pushback (TBUFF *buf, int skip); extern void set_end_string (int c);