[tin-dev] [patch] extend -w

Urs Janßen urs at tin.org
Wed Feb 22 14:18:27 CET 2017


If a group was given on the cmd.-line -w still asked for the group to
post to... comments?

=== modified file 'include/proto.h'
--- include/proto.h	2016-10-12 15:40:33 +0000
+++ include/proto.h	2017-02-22 13:13:08 +0000
@@ -501,7 +501,7 @@
 extern t_bool reread_active_after_posting(void);
 extern t_bool user_posted_messages(void);
 extern void init_postinfo(void);
-extern void quick_post_article(t_bool postponed_only);
+extern void quick_post_article(t_bool postponed_only, int num_cmd_line_groups);
 #if defined(SIGWINCH) || defined(SIGTSTP)
 	extern void refresh_post_screen(int context);
 #endif /* SIGWINCH || SIGTSTP */

=== modified file 'src/main.c'
--- src/main.c	2016-10-12 15:40:33 +0000
+++ src/main.c	2017-02-22 13:12:05 +0000
@@ -305,7 +305,7 @@
 	 */
 	if (post_article_and_exit || post_postponed_and_exit) {
 		no_write = tmp_no_write; /* restore original value */
-		quick_post_article(post_postponed_and_exit);
+		quick_post_article(post_postponed_and_exit, num_cmd_line_groups);
 		wait_message(2, _(txt_exiting));
 		no_write = TRUE; /* disable newsrc updates */
 		tin_done(EXIT_SUCCESS, NULL);

=== modified file 'src/post.c'
--- src/post.c	2017-02-21 23:02:13 +0000
+++ src/post.c	2017-02-22 13:12:41 +0000
@@ -2250,7 +2250,8 @@
  */
 void
 quick_post_article(
-	t_bool postponed_only)
+	t_bool postponed_only,
+	int num_cmd_line_groups)
 {
 	char buf[HEADER_LEN];
 	int art_type = GROUP_TYPE_NEWS;
@@ -2273,9 +2274,11 @@
 	/*
 	 * Get groupname
 	 */
-	snprintf(buf, sizeof(buf), _(txt_post_newsgroups), tinrc.default_post_newsgroups);
-	if (!(prompt_string_default(buf, tinrc.default_post_newsgroups, _(txt_no_newsgroups), HIST_POST_NEWSGROUPS)))
-		return;
+	if (!(post_article_and_exit && num_cmd_line_groups)) {
+		snprintf(buf, sizeof(buf), _(txt_post_newsgroups), tinrc.default_post_newsgroups);
+		if (!(prompt_string_default(buf, tinrc.default_post_newsgroups, _(txt_no_newsgroups), HIST_POST_NEWSGROUPS)))
+			return;
+	}
 
 	/*
 	 * Strip double newsgroups



More information about the tin-dev mailing list