[tin 1.7.x] fix for prompt_to_send()

Urs Janßen <[email protected]>
Newsgroups gmane.network.tin.devel
Message-ID <[email protected]>
the attached patch is over the last snapshot + Michaels prompt_yn()
patch, it fixes a bug in prompt_to_send() (returned char instead of
t_function, so the result was interpreted wrong), some wrong help-texts
in the online help and the debian bug #294802 (translated filter-menu
text too long).

urs
-- 
"Only whimps use tape backup: _real_ men just upload their important stuff
 on ftp, and let the rest of the world mirror it ;)" - Linus
tin-1.7.8.snaptotin-1.7.8.diff (text/plain, 6.6 KB)
diff -Nurp tin-1.7.8.snap/src/filter.c tin-1.7.8/src/filter.c
--- tin-1.7.8.snap/src/filter.c	2005-02-01 11:23:57.000000000 +0100
+++ tin-1.7.8/src/filter.c	2005-02-12 15:00:56.000000000 +0100
@@ -1063,7 +1063,7 @@ filter_menu(
 	ptr_filter_comment = _(txt_filter_comment);
 	ptr_filter_groupname = group->name;
 
-	len = cCOLS - 30;
+	len = cCOLS - 33;
 
 	snprintf(text_time, sizeof(text_time), _(txt_time_default_days), tinrc.filter_days);
 	fmt_filter_menu_prompt(text_subj, sizeof(text_subj), ptr_filter_subj, len, art->subject);
diff -Nurp tin-1.7.8.snap/src/group.c tin-1.7.8/src/group.c
--- tin-1.7.8.snap/src/group.c	2005-02-01 11:24:21.000000000 +0100
+++ tin-1.7.8/src/group.c	2005-02-14 16:41:18.000000000 +0100
@@ -149,7 +149,7 @@ group_page(
 	t_bool flag;
 	t_bool range_active = FALSE;		/* Set if a range is defined */
 	t_bool xflag = FALSE;	/* 'X'-flag */
-	t_bool repeat_search = FALSE;
+	t_bool repeat_search;
 	t_function func;
 
 	/*
diff -Nurp tin-1.7.8.snap/src/help.c tin-1.7.8/src/help.c
--- tin-1.7.8.snap/src/help.c	2005-02-01 11:24:35.000000000 +0100
+++ tin-1.7.8/src/help.c	2005-02-14 16:28:43.000000000 +0100
@@ -74,8 +74,8 @@ static t_help_page select_help_page[] = 
 	{ txt_help_select_goto_group, SELECT_GOTO },
 	{ txt_help_select_next_unread_group, SELECT_NEXT_UNREAD_GROUP },
 	{ txt_help_empty_line, NOT_ASSIGNED },
-	{ txt_help_select_search_group_forwards, GLOBAL_SEARCH_SUBJECT_FORWARD },
-	{ txt_help_select_search_group_backwards, GLOBAL_SEARCH_SUBJECT_BACKWARD },
+	{ txt_help_global_search_subj_forwards, GLOBAL_SEARCH_SUBJECT_FORWARD },
+	{ txt_help_global_search_subj_backwards, GLOBAL_SEARCH_SUBJECT_BACKWARD },
 	{ txt_help_select_search_group_comment, NOT_ASSIGNED },
 	{ txt_help_global_search_repeat, GLOBAL_SEARCH_REPEAT },
 	{ txt_help_empty_line, NOT_ASSIGNED },
@@ -167,6 +167,7 @@ static t_help_page group_help_page[] = {
 	{ txt_help_global_toggle_color, GLOBAL_TOGGLE_COLOR },
 #endif /* HAVE_COLOR */
 	{ txt_help_empty_line, NOT_ASSIGNED },
+	{ txt_help_global_toggle_subj_display, GROUP_TOGGLE_SUBJECT_DISPLAY},
 	{ txt_help_group_toggle_threading, GROUP_TOGGLE_THREADING },
 	{ txt_help_group_mark_unsel_art_read, GROUP_MARK_UNSELECTED_ARTICLES_READ },
 	{ txt_help_group_toggle_getart_limit, GROUP_TOGGLE_GET_ARTICLES_LIMIT },
@@ -256,7 +257,7 @@ static t_help_page thread_help_page[] = 
 	{ txt_help_empty_line, NOT_ASSIGNED },
 	{ txt_help_title_disp, NOT_ASSIGNED },
 	{ txt_help_global_toggle_info_line, GLOBAL_TOGGLE_INFO_LAST_LINE },
-	{ txt_help_select_toggle_descriptions, SELECT_TOGGLE_DESCRIPTIONS },
+	{ txt_help_global_toggle_subj_display, THREAD_TOGGLE_SUBJECT_DISPLAY},
 	{ txt_help_global_toggle_inverse_video, GLOBAL_TOGGLE_INVERSE_VIDEO },
 #ifdef HAVE_COLOR
 	{ txt_help_global_toggle_color, GLOBAL_TOGGLE_COLOR },
@@ -332,8 +333,8 @@ static t_help_page page_help_page[] = {
 	{ txt_help_article_quit_to_select_level, PAGE_GROUP_SELECT },
 	{ txt_help_article_skip_quote, PAGE_SKIP_INCLUDED_TEXT },
 	{ txt_help_empty_line, NOT_ASSIGNED },
-	{ txt_help_global_search_subj_forwards, GLOBAL_SEARCH_SUBJECT_FORWARD },
-	{ txt_help_global_search_subj_backwards, GLOBAL_SEARCH_SUBJECT_BACKWARD },
+	{ txt_help_article_search_forwards, GLOBAL_SEARCH_SUBJECT_FORWARD },
+	{ txt_help_article_search_backwards, GLOBAL_SEARCH_SUBJECT_BACKWARD },
 	{ txt_help_global_search_auth_forwards, GLOBAL_SEARCH_AUTHOR_FORWARD },
 	{ txt_help_global_search_auth_backwards, GLOBAL_SEARCH_AUTHOR_BACKWARD },
 	{ txt_help_global_search_body, GLOBAL_SEARCH_BODY },
diff -Nurp tin-1.7.8.snap/src/memory.c tin-1.7.8/src/memory.c
--- tin-1.7.8.snap/src/memory.c	2004-12-30 14:33:11.000000000 +0100
+++ tin-1.7.8/src/memory.c	2005-02-14 15:30:39.000000000 +0100
@@ -43,15 +43,15 @@
 #endif /* !RFC2046_H */
 
 /*
- * Dynamic arrays maximum & current sizes
+ * Dynamic arrays maximum (initialized in init_alloc()) & current sizes
  * num_* values are one past top of used part of array
  */
-int max_active = 0;
+int max_active;
 int num_active = -1;
-int max_newnews = 0;
+int max_newnews;
 int num_newnews = 0;
-int max_art = 0;
-int max_save = 0;
+int max_art;
+int max_save;
 int num_save = 0;
 
 /*
diff -Nurp tin-1.7.8.snap/src/post.c tin-1.7.8/src/post.c
--- tin-1.7.8.snap/src/post.c	2005-02-01 11:26:09.000000000 +0100
+++ tin-1.7.8/src/post.c	2005-02-15 15:43:15.000000000 +0100
@@ -185,7 +185,6 @@ prompt_to_send(
 	const char *subject)
 {
 	char *smsg;
-	char option;
 	char buf[LEN];
 	char keyedit[MAXKEYLEN];
 	char keyquit[MAXKEYLEN];
@@ -196,6 +195,7 @@ prompt_to_send(
 #ifdef HAVE_PGP_GPG
 	char keypgp[MAXKEYLEN];
 #endif /* HAVE_PGP_GPG */
+	t_function func;
 
 	snprintf(buf, sizeof(buf), _(txt_quit_edit_send),
 					printascii(keyquit, func_to_key(GLOBAL_QUIT, post_send_keys)),
@@ -208,10 +208,10 @@ prompt_to_send(
 #endif /* HAVE_PGP_GPG */
 					printascii(keysend, func_to_key(POST_SEND, post_send_keys)));
 
-	option = prompt_slk_response(POST_SEND, post_send_keys, "%s",
+	func = prompt_slk_response(POST_SEND, post_send_keys, "%s",
 				sized_message(&smsg, buf, subject));
 	free(smsg);
-	return option;
+	return func;
 }
 
 
@@ -1548,7 +1548,6 @@ post_article_loop:
 					else if (func == POST_EDIT) {
 						/* replace modified article with clean backup */
 						rename_file(backup_article_name(article), article);
-						func = POST_EDIT;
 						goto post_article_loop;
 					} else {
 						unlink(backup_article_name(article));
@@ -3279,8 +3278,8 @@ cancel_article(
 	int oldraw;
 	struct t_header note_h = pgart.hdr, hdr;
 	t_bool redraw_screen = FALSE;
-	t_function option = POST_CANCEL;
-	t_function option_default = POST_CANCEL;
+	t_function func = POST_CANCEL;
+	t_function default_func = POST_CANCEL;
 
 	msg_init_headers();
 
@@ -3320,11 +3319,11 @@ cancel_article(
 				printascii(keysupersede, func_to_key(POST_SUPERSEDE, post_delete_keys)),
 				printascii(keyquit, func_to_key(GLOBAL_QUIT, post_delete_keys)));
 
-		option = prompt_slk_response(option_default, post_delete_keys,
+		func = prompt_slk_response(default_func, post_delete_keys,
 						"%s", sized_message(&smsg, buff, art->subject));
 		free(smsg);
 
-		switch (option) {
+		switch (func) {
 			case POST_CANCEL:
 				break;
 
@@ -3463,11 +3462,11 @@ cancel_article(
 					printascii(keyquit, func_to_key(GLOBAL_QUIT, post_cancel_keys)),
 					printascii(keycancel, func_to_key(POST_CANCEL, post_cancel_keys)));
 
-			option = prompt_slk_response(option_default, post_cancel_keys, "%s", sized_message(&smsg, buff, note_h.subj));
+			func = prompt_slk_response(default_func, post_cancel_keys, "%s", sized_message(&smsg, buff, note_h.subj));
 			free(smsg);
 		}
 
-		switch (option) {
+		switch (func) {
 			case POST_EDIT:
 				invoke_editor(cancel, start_line_offset);
 				if (!(fp = fopen(cancel, "r"))) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.