[tin-dev] [PATCH] guard against empty inews_prog
Urs Janßen
urs at tin.org
Thu Mar 3 13:05:06 CET 2022
with unset inews_prog posting do vanish without any error message, if one
really needs to have some kind of no-op as inews_prog (e.g. as the posting
is actually sent from the $EDITOR directly) one still could set
inews_prog=/bin/true or the like.
=== modified file 'src/config.c'
--- src/config.c 2022-02-21 22:38:50 +0000
+++ src/config.c 2022-03-03 11:52:07 +0000
@@ -920,6 +920,8 @@
STRCPY(tinrc.thread_format, DEFAULT_THREAD_FORMAT);
if (!*tinrc.date_format)
STRCPY(tinrc.date_format, DEFAULT_DATE_FORMAT);
+ if (!*tinrc.inews_prog)
+ STRCPY(tinrc.inews_prog, INTERNAL_CMD);
/* determine local charset */
#if defined(NO_LOCALE) && !defined(CHARSET_CONVERSION)
strcpy(tinrc.mm_local_charset, tinrc.mm_charset);
=== modified file 'src/options_menu.c'
--- src/options_menu.c 2022-02-21 22:38:50 +0000
+++ src/options_menu.c 2022-03-03 11:56:17 +0000
@@ -2088,7 +2088,6 @@
case OPT_STRING:
switch (option) {
- case OPT_INEWS_PROG:
case OPT_MAILDIR:
case OPT_MAILER_FORMAT:
case OPT_MAIL_ADDRESS:
@@ -2124,6 +2123,14 @@
}
break;
+ case OPT_INEWS_PROG:
+ if (prompt_option_string(option)) {
+ if (!strlen(tinrc.inews_prog))
+ STRCPY(tinrc.inews_prog, INTERNAL_CMD);
+ changed |= MISC_OPTS;
+ }
+ break;
+
case OPT_ATTRIB_GROUP_FORMAT:
if (prompt_option_string(option))
SET_STRING_ATTRIBUTE(group_format);
More information about the tin-dev
mailing list