home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-10-19 | 48.7 KB | 1,810 lines |
- Newsgroups: comp.sources.misc
- From: iain@norisc.siemens.de (Iain J. Lea)
- Subject: v23i079: tin - threaded full screen newsreader, Patch03b/4
- Message-ID: <1991Oct20.032014.24635@sparky.imd.sterling.com>
- X-Md4-Signature: 4ee46096c076afac08b5a0eeafc6d324
- Date: Sun, 20 Oct 1991 03:20:14 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: iain@norisc.siemens.de (Iain J. Lea)
- Posting-number: Volume 23, Issue 79
- Archive-name: tin/patch03b
- Environment: BSD, SCO, ISC, SUNOS, SYSVR3, SYSVR4, ULTRIX, XENIX
- Patch-To: tin: Volume 23, Issue 15-23
-
- #!/bin/sh
- # this is tin.patch.02 (part 2 of tin1.0)
- # do not concatenate these parts, unpack them in order with /bin/sh
- # file tin.patch03 continued
- #
- if touch 2>&1 | fgrep '[-amc]' > /dev/null
- then TOUCH=touch
- else TOUCH=true
- fi
- if test ! -r shar3_seq_.tmp; then
- echo "Please unpack part 1 first!"
- exit 1
- fi
- (read Scheck
- if test "$Scheck" != 2; then
- echo "Please unpack part $Scheck next!"
- exit 1
- else
- exit 0
- fi
- ) < shar3_seq_.tmp || exit 1
- echo "x - Continuing file tin.patch03"
- sed 's/^X//' << 'SHAR_EOF' >> tin.patch03 &&
- X! tin_done(0);
- X }
- X
- X
- X--- 591,601 ----
- X group_done:
- X fix_new_highest (sav_groupnum);
- X update_newsrc (group, my_group[sav_groupnum], FALSE);
- X
- X! if (index_point == -2) {
- X! tin_done (0);
- X! }
- X! clear_note_area ();
- X }
- X
- X
- X***************
- X*** 652,658 ****
- X CleartoEOLN ();
- X #endif
- X
- X! sprintf (buf, "%s (%d)", group, top_base);
- X center_line (0, TRUE, buf);
- X
- X if (col = (COLS - (int) strlen (txt_type_h_for_help))+1) {
- X--- 657,667 ----
- X CleartoEOLN ();
- X #endif
- X
- X! if (active[my_group[cur_groupnum]].thread) {
- X! sprintf (buf, "%s (%d %d)", group, top_base, top);
- X! } else {
- X! sprintf (buf, "%s (U %d)", group, top);
- X! }
- X center_line (0, TRUE, buf);
- X
- X if (col = (COLS - (int) strlen (txt_type_h_for_help))+1) {
- X***************
- X*** 708,719 ****
- X }
- X
- X for (j=0, i = first_subj_on_screen; i < last_subj_on_screen; i++, j++) {
- X! respnum = base[i];
- X
- X if (arts[respnum].tagged) {
- X sprintf (new_resps, "%3d", arts[respnum].tagged);
- X } else if (new_responses(i)) {
- X! strcpy (new_resps, " +");
- X } else {
- X strcpy (new_resps, " ");
- X }
- X--- 717,728 ----
- X }
- X
- X for (j=0, i = first_subj_on_screen; i < last_subj_on_screen; i++, j++) {
- X! respnum = (int) base[i];
- X
- X if (arts[respnum].tagged) {
- X sprintf (new_resps, "%3d", arts[respnum].tagged);
- X } else if (new_responses(i)) {
- X! sprintf (new_resps, " %c", UNREAD_ART_MARK);
- X } else {
- X strcpy (new_resps, " ");
- X }
- X***************
- X*** 818,824 ****
- X int i;
- X int sum = 0;
- X
- X! for (i = base[thread]; i >= 0; i = arts[i].thread)
- X if (arts[i].unread)
- X sum++;
- X
- X--- 827,833 ----
- X int i;
- X int sum = 0;
- X
- X! for (i = (int) base[thread]; i >= 0; i = arts[i].thread)
- X if (arts[i].unread)
- X sum++;
- X
- Xdiff -rcs 102/hashstr.c 103/hashstr.c
- X*** 102/hashstr.c Mon Sep 23 17:55:38 1991
- X--- 103/hashstr.c Mon Sep 30 18:35:58 1991
- X***************
- X*** 68,74 ****
- X
- X h = *t++;
- X while (*t)
- X! h = ((h << 1) ^ *t++) % TABLE_SIZE;
- X }
- X
- X p = table[h];
- X--- 68,74 ----
- X
- X h = *t++;
- X while (*t)
- X! h = ((h << 1) ^ *t++) % (long) TABLE_SIZE;
- X }
- X
- X p = table[h];
- X***************
- X*** 99,105 ****
- X struct hashnode *p;
- X int *iptr;
- X
- X! p = (struct hashnode *) my_malloc (sizeof (*p));
- X
- X p->next = (struct hashnode *) 0;
- X iptr = (int *) my_malloc ((unsigned) strlen (s) + sizeof (int)+1);
- X--- 99,105 ----
- X struct hashnode *p;
- X int *iptr;
- X
- X! p = (struct hashnode *) my_malloc ((unsigned) sizeof (*p));
- X
- X p->next = (struct hashnode *) 0;
- X iptr = (int *) my_malloc ((unsigned) strlen (s) + sizeof (int)+1);
- Xdiff -rcs 102/help.c 103/help.c
- X*** 102/help.c Tue Sep 24 08:39:25 1991
- X--- 103/help.c Mon Sep 30 12:35:19 1991
- X***************
- X*** 3,9 ****
- X * Module : help.c
- X * Author : R.Skrenta / I.Lea
- X * Created : 01-04-91
- X! * Updated : 24-09-91
- X * Release : 1.0
- X * Notes :
- X * Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
- X--- 3,9 ----
- X * Module : help.c
- X * Author : R.Skrenta / I.Lea
- X * Created : 01-04-91
- X! * Updated : 26-09-91
- X * Release : 1.0
- X * Notes :
- X * Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
- X***************
- X*** 130,136 ****
- X char *help[];
- X char *title;
- X {
- X! char buf[LEN+1];
- X char ch;
- X int i, len;
- X int group_len = 0;
- X--- 130,136 ----
- X char *help[];
- X char *title;
- X {
- X! char buf[LEN];
- X char ch;
- X int i, len;
- X int group_len = 0;
- X***************
- X*** 253,258 ****
- X--- 253,259 ----
- X break;
- X
- X case ctrl('R'): /* Home */
- X+ case 'g':
- X if (cur_page != 1) {
- X cur_page = 1;
- X pos_help = 0;
- X***************
- X*** 260,265 ****
- X--- 261,267 ----
- X break;
- X
- X case '$': /* End */
- X+ case 'G':
- X if (cur_page != max_page) {
- X cur_page = max_page;
- X pos_help = (max_page-1) * NOTESLINES;
- Xdiff -rcs 102/kill.c 103/kill.c
- X*** 102/kill.c Mon Sep 23 17:55:38 1991
- X--- 103/kill.c Mon Sep 30 18:14:57 1991
- X***************
- X*** 3,9 ****
- X * Module : kill.c
- X * Author : I.Lea
- X * Created : 01-04-91
- X! * Updated : 28-08-91
- X * Release : 1.0
- X * Notes : kill articles
- X * Copyright : (c) Copyright 1991 by Iain Lea
- X--- 3,9 ----
- X * Module : kill.c
- X * Author : I.Lea
- X * Created : 01-04-91
- X! * Updated : 30-09-91
- X * Release : 1.0
- X * Notes : kill articles
- X * Copyright : (c) Copyright 1991 by Iain Lea
- X***************
- X*** 15,21 ****
- X
- X #include "tin.h"
- X
- X! extern char index_file[LEN+1];
- X
- X struct kill_t *killf;
- X int kill_num = 0;
- X--- 15,21 ----
- X
- X #include "tin.h"
- X
- X! extern char index_file[LEN];
- X
- X struct kill_t *killf;
- X int kill_num = 0;
- X***************
- X*** 27,33 ****
- X
- X int read_kill_file ()
- X {
- X! char buf[LEN+1];
- X FILE *fp;
- X
- X free_kill_array ();
- X--- 27,33 ----
- X
- X int read_kill_file ()
- X {
- X! char buf[LEN];
- X FILE *fp;
- X
- X free_kill_array ();
- X***************
- X*** 140,161 ****
- X char *group_name;
- X int index;
- X {
- X! char text[LEN+1];
- X! char kill_from[LEN+1];
- X! char kill_subj[LEN+1];
- X! char kill_group[LEN+1];
- X char ch_default = 's';
- X char *str;
- X int ch;
- X int counter;
- X int kill_from_ok = FALSE;
- X int kill_subj_ok = FALSE;
- X int kill_every_group;
- X
- X sprintf (kill_group, "%s only", group_name);
- X! my_strncpy (text, arts[index].subject, 45);
- X sprintf (kill_subj, txt_kill_subject, text);
- X! my_strncpy (text, arts[index].from, 45);
- X sprintf (kill_from, txt_kill_from, text);
- X text[0] = '\0';
- X
- X--- 140,180 ----
- X char *group_name;
- X int index;
- X {
- X! char text[LEN];
- X! char kill_from[LEN];
- X! char kill_subj[LEN];
- X! char kill_group[LEN];
- X char ch_default = 's';
- X char *str;
- X int ch;
- X int counter;
- X+ int killed = TRUE;
- X int kill_from_ok = FALSE;
- X int kill_subj_ok = FALSE;
- X int kill_every_group;
- X+
- X+ #ifdef SIGTSTP
- X+ void (*susp)();
- X+
- X+ if (do_sigtstp) {
- X+ #ifdef POSIX_JOB_CONTROL
- X+ sigemptyset (&kill_act.sa_mask);
- X+ kill_act.sa_flags = SA_RESTART | SA_RESETHAND;
- X+ kill_act.sa_handler = SIG_DFL;
- X+ sigaction (SIGTSTP, &kill_act, &old_act);
- X+ kill_act.sa_handler = SIG_IGN;
- X+ sigaction (SIGTSTP, &kill_act, 0L);
- X+ #else
- X+ susp = signal (SIGTSTP, SIG_DFL);
- X+ signal (SIGTSTP, SIG_IGN);
- X+ #endif
- X+ }
- X+ #endif
- X
- X sprintf (kill_group, "%s only", group_name);
- X! my_strncpy (text, arts[index].subject, COLS-35);
- X sprintf (kill_subj, txt_kill_subject, text);
- X! my_strncpy (text, arts[index].from, COLS-35);
- X sprintf (kill_from, txt_kill_from, text);
- X text[0] = '\0';
- X
- X***************
- X*** 172,188 ****
- X fflush(stdout);
- X
- X show_menu_help (txt_help_kill_text);
- X! parse_menu_string (INDEX_TOP, strlen (txt_kill_text), text);
- X
- X if (text[0]) {
- X show_menu_help (txt_help_kill_text_type);
- X counter = 1;
- X! MoveCursor (INDEX_TOP+2, strlen (txt_kill_text_type));
- X str = "Subject: line only ";
- X printf ("%s", str);
- X fflush(stdout);
- X do {
- X! MoveCursor (INDEX_TOP+2, strlen (txt_kill_text_type));
- X if ((ch = ReadCh()) == ' ') {
- X counter++;
- X if (counter == KILL_BOTH+1) {
- X--- 191,207 ----
- X fflush(stdout);
- X
- X show_menu_help (txt_help_kill_text);
- X! parse_menu_string (INDEX_TOP, (int) strlen (txt_kill_text), text);
- X
- X if (text[0]) {
- X show_menu_help (txt_help_kill_text_type);
- X counter = 1;
- X! MoveCursor (INDEX_TOP+2, (int) strlen (txt_kill_text_type));
- X str = "Subject: line only ";
- X printf ("%s", str);
- X fflush(stdout);
- X do {
- X! MoveCursor (INDEX_TOP+2, (int) strlen (txt_kill_text_type));
- X if ((ch = ReadCh()) == ' ') {
- X counter++;
- X if (counter == KILL_BOTH+1) {
- X***************
- X*** 216,227 ****
- X if (text[0] || kill_subj_ok || kill_from_ok) {
- X show_menu_help (txt_help_kill_group);
- X kill_every_group = FALSE;
- X! MoveCursor (INDEX_TOP+10, strlen (txt_kill_group));
- X str = kill_group;
- X printf ("%s", str);
- X fflush(stdout);
- X do {
- X! MoveCursor (INDEX_TOP+10, strlen (txt_kill_group));
- X if ((ch = ReadCh()) == ' ') {
- X kill_every_group = !kill_every_group;
- X if (kill_every_group) {
- X--- 235,246 ----
- X if (text[0] || kill_subj_ok || kill_from_ok) {
- X show_menu_help (txt_help_kill_group);
- X kill_every_group = FALSE;
- X! MoveCursor (INDEX_TOP+10, (int) strlen (txt_kill_group));
- X str = kill_group;
- X printf ("%s", str);
- X fflush(stdout);
- X do {
- X! MoveCursor (INDEX_TOP+10, (int) strlen (txt_kill_group));
- X if ((ch = ReadCh()) == ' ') {
- X kill_every_group = !kill_every_group;
- X if (kill_every_group) {
- X***************
- X*** 240,246 ****
- X do {
- X sprintf (msg, "%s%c", txt_abort_edit_save_killfile, ch_default);
- X wait_message (msg);
- X! MoveCursor(LINES, strlen (txt_abort_edit_save_killfile));
- X if ((ch = ReadCh()) == CR)
- X ch = ch_default;
- X } while (ch != 'a' && ch != 'e' && ch != 's');
- X--- 259,265 ----
- X do {
- X sprintf (msg, "%s%c", txt_abort_edit_save_killfile, ch_default);
- X wait_message (msg);
- X! MoveCursor(LINES, (int) strlen (txt_abort_edit_save_killfile));
- X if ((ch = ReadCh()) == CR)
- X ch = ch_default;
- X } while (ch != 'a' && ch != 'e' && ch != 's');
- X***************
- X*** 251,260 ****
- X untag_all_articles ();
- X read_kill_file ();
- X reload_index_file (group_name, FALSE);
- X! return TRUE;
- X
- X case 'a':
- X! return FALSE;
- X
- X case 's':
- X if (kill_num > max_kill-1) {
- X--- 270,281 ----
- X untag_all_articles ();
- X read_kill_file ();
- X reload_index_file (group_name, FALSE);
- X! killed = TRUE;
- X! goto kill_done;
- X
- X case 'a':
- X! killed = FALSE;
- X! goto kill_done;
- X
- X case 's':
- X if (kill_num > max_kill-1) {
- X***************
- X*** 299,305 ****
- X }
- X }
- X write_kill_file ();
- X! return TRUE;
- X }
- X }
- X /* NOTREACHED */
- X--- 320,341 ----
- X }
- X }
- X write_kill_file ();
- X!
- X! kill_done:
- X!
- X! #ifdef SIGTSTP
- X! if (do_sigtstp) {
- X! #ifdef POSIX_JOB_CONTROL
- X! sigemptyset (&kill_act.sa_mask);
- X! kill_act.sa_flags = SA_RESTART | SA_RESETHAND;
- X! kill_act.sa_handler = SIG_IGN;
- X! sigaction (SIGTSTP, &old_act, 0L);
- X! #else
- X! signal (SIGTSTP, susp);
- X! #endif
- X! }
- X! #endif
- X! return (killed);
- X }
- X }
- X /* NOTREACHED */
- Xdiff -rcs 102/lang.c 103/lang.c
- X*** 102/lang.c Tue Sep 24 14:01:45 1991
- X--- 103/lang.c Mon Sep 30 18:29:55 1991
- X***************
- X*** 3,9 ****
- X * Module : lang.c
- X * Author : R.Skrenta / I.Lea
- X * Created : 01-04-91
- X! * Updated : 24-09-91
- X * Release : 1.0
- X * Notes :
- X * Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
- X--- 3,9 ----
- X * Module : lang.c
- X * Author : R.Skrenta / I.Lea
- X * Created : 01-04-91
- X! * Updated : 30-09-91
- X * Release : 1.0
- X * Notes :
- X * Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
- X***************
- X*** 23,29 ****
- X
- X char txt_group[] = "Group %s... ";
- X char txt_cannot_open_art[] = "can't open article %s: ";
- X! char txt_indexing[] = "Indexing...%4d";
- X char txt_corrupt_index[] = "Index file %s corrupted. error %d on article %d";
- X
- X /*
- X--- 23,30 ----
- X
- X char txt_group[] = "Group %s... ";
- X char txt_cannot_open_art[] = "can't open article %s: ";
- X! char txt_indexing[] = "Indexing...";
- X! char txt_indexing_num[] = "Indexing...%4d";
- X char txt_corrupt_index[] = "Index file %s corrupted. error %d on article %d";
- X
- X /*
- X***************
- X*** 50,56 ****
- X char txt_subscribed_to[] = "subscribed to %s";
- X char txt_unsubscribed_to[] = "unsubscribed from %s";
- X char txt_mark_all_read[] = "Mark everything as read? (y/n): ";
- X- char txt_marked_as_read[] = "All articles marked as read";
- X char txt_no_more_groups[] = "No more groups";
- X char txt_no_prev_group[] = "No previous group";
- X char txt_no_arts[] = "*** No Articles ***";
- X--- 51,56 ----
- X***************
- X*** 110,116 ****
- X #else
- X char txt_save_pattern[] = "Enter regex save pattern [%s]> ";
- X #endif
- X- char txt_base_subdir[] = "Enter sub directory name> ";
- X char txt_saved_pattern_to[] = "-- Saved pattern to %s - %s --";
- X char txt_saved_to_mailbox[] = "-- Saved to mailbox %s --";
- X char txt_switch_on_kill_art_menu[] = "Kill Article Menu is switched OFF. Select Options Menu to switch it ON.";
- X--- 110,115 ----
- X***************
- X*** 158,164 ****
- X char txt_cannot_find_base_art[] = "Cannot find base article %s";
- X char txt_out_of_memory[] = "%s: out of memory";
- X char txt_rename_error[] = "Error: rename %s to %s";
- X! char txt_shell_escape[] = "Enter shell command> ";
- X
- X /*
- X * nntp_open.c
- X--- 157,163 ----
- X char txt_cannot_find_base_art[] = "Cannot find base article %s";
- X char txt_out_of_memory[] = "%s: out of memory";
- X char txt_rename_error[] = "Error: rename %s to %s";
- X! char txt_shell_escape[] = "Enter shell command [%s]> ";
- X
- X /*
- X * nntp_open.c
- X***************
- X*** 243,249 ****
- X char txt_thread_saved_to_many[] = "-- Thread saved to %s - %s --";
- X char txt_thread_saved_to[] = "-- Thread saved to %s --";
- X char txt_pipe_to_command[] = "Pipe to command [%s]: ";
- X- char txt_error_printing_art[] = "-- Error printing article --";
- X char txt_printing[] = "Printing...";
- X char txt_printed[] = "-- Article(s) printed --";
- X char txt_append_to_file[] = "File %s exists. Append? (y/n): ";
- X--- 242,247 ----
- X***************
- X*** 294,300 ****
- X char txt_sort_by_date_ascend[] = "Date: field (ascending)";
- X char txt_help_autosave[] = "Auto save article/thread by Archive-name: header. <SPACE> toggles & <CR> sets.";
- X char txt_help_save_separate[] = "Save articles/threads to separate files. <SPACE> toggles & <CR> sets.";
- X! char txt_help_print_header[] = "Print complete mail header or Subject: & From:. <SPACE> toggles & <CR> sets.";
- X char txt_help_pos_first_unread[] = "Put cursor at first/last unread art in groups. <SPACE> toggles & <CR> sets.";
- X char txt_help_show_author[] = "Show Subject & From (author) fields in group menu. <SPACE> toggles & <CR> sets.";
- X char txt_help_draw_arrow[] = "Draw -> or highlighted bar for selection. <SPACE> toggles & <CR> sets.";
- X--- 292,298 ----
- X char txt_sort_by_date_ascend[] = "Date: field (ascending)";
- X char txt_help_autosave[] = "Auto save article/thread by Archive-name: header. <SPACE> toggles & <CR> sets.";
- X char txt_help_save_separate[] = "Save articles/threads to separate files. <SPACE> toggles & <CR> sets.";
- X! char txt_help_print_header[] = "By printing print all/part of header. <SPACE> toggles & <CR> sets.";
- X char txt_help_pos_first_unread[] = "Put cursor at first/last unread art in groups. <SPACE> toggles & <CR> sets.";
- X char txt_help_show_author[] = "Show Subject & From (author) fields in group menu. <SPACE> toggles & <CR> sets.";
- X char txt_help_draw_arrow[] = "Draw -> or highlighted bar for selection. <SPACE> toggles & <CR> sets.";
- X***************
- X*** 306,312 ****
- X char txt_help_maildir[] = "The directory where articles/threads are to be saved in mailbox format.";
- X char txt_help_printer[] = "The printer program with options that is to be used to print articles/threads.";
- X char txt_select_rcfile_option[] = "Select option by entering number before text. Any other key to save.";
- X- char txt_save_options[] = "Save options? (y/n): ";
- X
- X /*
- X * save.c
- X--- 304,309 ----
- Xdiff -rcs 102/lang.h 103/lang.h
- X*** 102/lang.h Tue Sep 24 08:37:45 1991
- X--- 103/lang.h Mon Sep 30 18:31:11 1991
- X***************
- X*** 3,9 ****
- X * Module : lang.h
- X * Author : I.Lea
- X * Created : 01-04-91
- X! * Updated : 24-09-91
- X * Release : 1.0
- X * Notes :
- X * Copyright : (c) Copyright 1991 by Iain Lea
- X--- 3,9 ----
- X * Module : lang.h
- X * Author : I.Lea
- X * Created : 01-04-91
- X! * Updated : 30-09-91
- X * Release : 1.0
- X * Notes :
- X * Copyright : (c) Copyright 1991 by Iain Lea
- X***************
- X*** 20,25 ****
- X--- 20,26 ----
- X extern char txt_group[];
- X extern char txt_cannot_open_art[];
- X extern char txt_indexing[];
- X+ extern char txt_indexing_num[];
- X extern char txt_corrupt_index[];
- X
- X /*
- X***************
- X*** 42,48 ****
- X extern char txt_subscribed_to[];
- X extern char txt_unsubscribed_to[];
- X extern char txt_mark_all_read[];
- X- extern char txt_marked_as_read[];
- X extern char txt_no_more_groups[];
- X extern char txt_no_prev_group[];
- X extern char txt_no_arts[];
- X--- 43,48 ----
- X***************
- X*** 94,106 ****
- X extern char txt_help_T[];
- X extern char txt_help_U[];
- X extern char txt_help_v[];
- X- extern char txt_help_i_u[];
- X extern char txt_help_w[];
- X extern char txt_help_i_search[];
- X extern char txt_help_thread[];
- X extern char txt_help_dash[];
- X extern char txt_save_pattern[];
- X- extern char txt_base_subdir[];
- X extern char txt_saved_pattern_to[];
- X extern char txt_saved_to_mailbox[];
- X extern char txt_switch_on_kill_art_menu[];
- X--- 94,104 ----
- X***************
- X*** 201,207 ****
- X extern char txt_thread_saved_to[];
- X extern char txt_pipe_to_command[];
- X extern char txt_command_failed[];
- X- extern char txt_error_printing_art[];
- X extern char txt_printing[];
- X extern char txt_printed[];
- X extern char txt_append_to_file[];
- X--- 199,204 ----
- X***************
- X*** 280,287 ****
- X extern char txt_opt_savedir[];
- X extern char txt_opt_maildir[];
- X extern char txt_opt_printer[];
- X- extern char txt_opt_kill_subj[];
- X- extern char txt_opt_kill_from[];
- X extern char txt_options_menu[];
- X extern char txt_help_autosave[];
- X extern char txt_help_save_separate[];
- X--- 277,282 ----
- X***************
- X*** 290,296 ****
- X extern char txt_help_show_author[];
- X extern char txt_help_draw_arrow[];
- X extern char txt_help_kill_articles[];
- X- extern char txt_help_post_process[];
- X extern char txt_help_mark_saved_read[];
- X extern char txt_help_post_proc_type[];
- X extern char txt_help_sort_type[];
- X--- 285,290 ----
- X***************
- X*** 298,304 ****
- X extern char txt_help_maildir[];
- X extern char txt_help_printer[];
- X extern char txt_select_rcfile_option[];
- X- extern char txt_save_options[];
- X
- X /*
- X * save.c
- X--- 292,297 ----
- X***************
- X*** 335,341 ****
- X extern char txt_reset_newsrc[];
- X extern char txt_no_groups_to_read[];
- X extern char txt_added_groups[];
- X- extern char txt_rewriting_newsrc_file[];
- X extern char txt_plural[];
- X extern char txt_no_groups_to_yank_in[];
- X extern char txt_group_selection[];
- X--- 328,333 ----
- Xdiff -rcs 102/main.c 103/main.c
- X*** 102/main.c Tue Sep 24 14:09:04 1991
- X--- 103/main.c Mon Sep 30 12:35:49 1991
- X***************
- X*** 3,9 ****
- X * Module : main.c
- X * Author : R.Skrenta / I.Lea
- X * Created : 01-04-91
- X! * Updated : 24-09-91
- X * Release : 1.0
- X * Notes :
- X * Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
- X--- 3,9 ----
- X * Module : main.c
- X * Author : R.Skrenta / I.Lea
- X * Created : 01-04-91
- X! * Updated : 29-09-91
- X * Release : 1.0
- X * Notes :
- X * Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
- X***************
- X*** 16,23 ****
- X #include "tin.h"
- X
- X char *version = "v1.0";
- X! char cvers[LEN+1];
- X! char nntp_server[LEN+1];
- X
- X int NOTESLINES; /* set in set_win_size () */
- X int RIGHT_POS; /* set in set_win_size () */
- X--- 16,23 ----
- X #include "tin.h"
- X
- X char *version = "v1.0";
- X! char cvers[LEN];
- X! char nntp_server[LEN];
- X
- X int NOTESLINES; /* set in set_win_size () */
- X int RIGHT_POS; /* set in set_win_size () */
- X***************
- X*** 58,69 ****
- X extern int optind;
- X extern char *optarg;
- X int c, i, created;
- X int notify_new_groups = FALSE;
- X struct stat st;
- X
- X debug = FALSE;
- X
- X! set_signal_handlers ();
- X
- X basename (argv[0], progname);
- X
- X--- 58,72 ----
- X extern int optind;
- X extern char *optarg;
- X int c, i, created;
- X+ int check_any_unread = FALSE;
- X int notify_new_groups = FALSE;
- X+ int start_any_unread = FALSE;
- X+ int start_groupnum = 0;
- X struct stat st;
- X
- X debug = FALSE;
- X
- X! set_signal_handlers (); /* all except SIGINT ctrl-C */
- X
- X basename (argv[0], progname);
- X
- X***************
- X*** 84,90 ****
- X init_selfinfo (); /* set up char *'s: homedir, newsrc, etc. */
- X init_alloc (); /* allocate initial array sizes */
- X
- X! while ((c = getopt (argc, argv, "cd:Df:hm:M:np:rs:SuUv")) != EOF) {
- X switch(c) {
- X case 'c':
- X catchup = TRUE;
- X--- 87,93 ----
- X init_selfinfo (); /* set up char *'s: homedir, newsrc, etc. */
- X init_alloc (); /* allocate initial array sizes */
- X
- X! while ((c = getopt (argc, argv, "cd:Df:hm:M:np:rs:SuUvzZ")) != EOF) {
- X switch(c) {
- X case 'c':
- X catchup = TRUE;
- X***************
- X*** 159,167 ****
- X--- 162,179 ----
- X
- X case 'v':
- X verbose = TRUE;
- X+ break;
- X+
- X+ case 'z':
- X+ start_any_unread = TRUE;
- X update = TRUE;
- X break;
- X
- X+ case 'Z':
- X+ check_any_unread = TRUE;
- X+ update = TRUE;
- X+ break;
- X+
- X case 'h':
- X case '?':
- X default:
- X***************
- X*** 196,201 ****
- X--- 208,214 ----
- X } else {
- X backup_newsrc ();
- X read_newsrc (TRUE);
- X+ mark_unthreaded_groups ();
- X }
- X
- X if (kill_articles) { /* read in users kill file */
- X***************
- X*** 203,213 ****
- X }
- X
- X /*
- X * save any new articles to savedir structure for later reading
- X */
- X if (save_news) {
- X do_update ();
- X! save_any_news ();
- X exit (0);
- X }
- X
- X--- 216,243 ----
- X }
- X
- X /*
- X+ * check/start if any new/unread articles
- X+ */
- X+ if (check_any_unread) {
- X+ i = check_start_save_any_news (CHECK_ANY_NEWS);
- X+ exit (i);
- X+ } else if (start_any_unread) {
- X+ start_groupnum = check_start_save_any_news (START_ANY_NEWS);
- X+ if (start_groupnum == -1) { /* no new/unread news so exit */
- X+ exit (0);
- X+ }
- X+ update = FALSE;
- X+ }
- X+
- X+ /*
- X * save any new articles to savedir structure for later reading
- X */
- X if (save_news) {
- X+ i = catchup; /* set catchup to FALSE */
- X+ catchup = FALSE;
- X do_update ();
- X! catchup = i; /* set catchup to previous value */
- X! check_start_save_any_news (SAVE_ANY_NEWS);
- X exit (0);
- X }
- X
- X***************
- X*** 214,230 ****
- X /*
- X * update index files
- X */
- X-
- X if (update || update_fork) {
- X! COLS = DEFAULT_COLS; /* set because curses has not started */
- X if (update_fork) {
- X! catchup = FALSE; /* turn off msgs when running forked */
- X verbose = FALSE;
- X! if (fork () == 0) { /* fork child to update indexes in background */
- X do_update ();
- X exit (0);
- X }
- X } else {
- X do_update ();
- X exit (0);
- X }
- X--- 244,262 ----
- X /*
- X * update index files
- X */
- X if (update || update_fork) {
- X! COLS = DEFAULT_COLS; /* set because curses has not started */
- X if (update_fork) {
- X! catchup = FALSE; /* turn off msgs when running forked */
- X verbose = FALSE;
- X! if (fork () == 0) { /* fork child to update indexes in background */
- X! thread_arts = FALSE; /* stop threading to run faster */
- X do_update ();
- X exit (0);
- X }
- X+ update = FALSE;
- X } else {
- X+ thread_arts = FALSE; /* stop threading to run faster */
- X do_update ();
- X exit (0);
- X }
- X***************
- X*** 244,252 ****
- X notify_groups ();
- X }
- X
- X! mail_setup (); /* record mailbox size for "you have mail" */
- X
- X! selection_index ();
- X
- X tin_done (0);
- X }
- X--- 276,284 ----
- X notify_groups ();
- X }
- X
- X! signal (SIGINT, signal_handler); /* catch ctrl-C */
- X
- X! selection_index (start_groupnum);
- X
- X tin_done (0);
- X }
- X***************
- X*** 259,279 ****
- X char *progname;
- X {
- X sprintf (msg, "%s %s PL%d - threaded usenet newsreader. Copyright 1991 Iain Lea.\n", progname, version, PATCHLEVEL);
- X! error_message (msg, "");
- X error_message ("Usage: %s [options] [newsgroups]", progname);
- X! error_message (" -c mark all articles as read in subscribed newsgroups", "");
- X error_message (" -d dir save articles to directory [default=%s]", savedir);
- X error_message (" -f file subscribed newsgroups file [default=%s]", newsrc);
- X! error_message (" -h help", "");
- X error_message (" -m file mail program [default=%s]", DEFAULT_MAILER);
- X! error_message (" -n notify user of any new newsgroups since last session", "");
- X error_message (" -M dir mailbox directory [default=%s]", maildir);
- X error_message (" -p file print program with options [default=%s]", DEFAULT_PRINTER);
- X error_message (" -r read news remotely from default NNTP server", DEFAULT_PRINTER);
- X error_message (" -s dir spool directory [default=%s]", SPOOLDIR);
- X! error_message (" -S save all new articles for later reading");
- X! error_message (" -u update index files only", "");
- X error_message (" -U fork %s -u to update index files in background", progname);
- X! error_message (" -v update index files only (verbose)", "");
- X error_message ("\nMail bug reports/gripes/comments to %s", BUG_REPORT_ADDRESS);
- X }
- X--- 291,313 ----
- X char *progname;
- X {
- X sprintf (msg, "%s %s PL%d - threaded usenet newsreader. Copyright 1991 Iain Lea.\n", progname, version, PATCHLEVEL);
- X! error_message (msg, (char *) 0);
- X error_message ("Usage: %s [options] [newsgroups]", progname);
- X! error_message (" -c mark all articles as read in subscribed newsgroups", (char *) 0);
- X error_message (" -d dir save articles to directory [default=%s]", savedir);
- X error_message (" -f file subscribed newsgroups file [default=%s]", newsrc);
- X! error_message (" -h help", (char *) 0);
- X error_message (" -m file mail program [default=%s]", DEFAULT_MAILER);
- X! error_message (" -n notify user of any new newsgroups since last session", (char *) 0);
- X error_message (" -M dir mailbox directory [default=%s]", maildir);
- X error_message (" -p file print program with options [default=%s]", DEFAULT_PRINTER);
- X error_message (" -r read news remotely from default NNTP server", DEFAULT_PRINTER);
- X error_message (" -s dir spool directory [default=%s]", SPOOLDIR);
- X! error_message (" -S save all new articles for later reading", (char *) 0);
- X! error_message (" -u update index files only", (char *) 0);
- X error_message (" -U fork %s -u to update index files in background", progname);
- X! error_message (" -v update index files only (verbose)", (char *) 0);
- X! error_message (" -z start if any unread news", (char *) 0);
- X! error_message (" -Z return status indicating if any unread news", (char *) 0);
- X error_message ("\nMail bug reports/gripes/comments to %s", BUG_REPORT_ADDRESS);
- X }
- XFiles 102/memory.c and 103/memory.c are identical
- Xdiff -rcs 102/misc.c 103/misc.c
- X*** 102/misc.c Mon Sep 23 20:02:20 1991
- X--- 103/misc.c Mon Sep 30 18:42:28 1991
- X***************
- X*** 3,9 ****
- X * Module : misc.c
- X * Author : R.Skrenta / I.Lea
- X * Created : 01-04-91
- X! * Updated : 23-09-91
- X * Release : 1.0
- X * Notes :
- X * Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
- X--- 3,9 ----
- X * Module : misc.c
- X * Author : R.Skrenta / I.Lea
- X * Created : 01-04-91
- X! * Updated : 30-09-91
- X * Release : 1.0
- X * Notes :
- X * Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
- X***************
- X*** 19,55 ****
- X char *mailbox_name = (char *) 0;
- X int mailbox_size;
- X
- X! char rcdir[LEN+1];
- X! char rcfile[LEN+1];
- X! char indexdir[LEN+1];
- X! char killfile[LEN+1];
- X! char postfile[LEN+1];
- X
- X! char active_file[LEN+1];
- X! char homedir[LEN+1];
- X! char userid[LEN+1];
- X! char delgroups[LEN+1];
- X! char newsrc[LEN+1];
- X! char newnewsrc[LEN+1];
- X! char add_addr[LEN+1]; /* address to add to rR reply to author with mail */
- X! char bug_addr[LEN+1]; /* address to add send bug reports to */
- X! char txt_help_bug_report[LEN+1]; /* address to add send bug reports to */
- X! char reply_to[LEN+1]; /* reply-to address */
- X! char my_org[LEN+1]; /* organization */
- X! char sig[LEN+1];
- X! char signature[LEN+1];
- X! char killsubj[LEN+1]; /* contains Subject:'s not to be shown */
- X! char killfrom[LEN+1]; /* conatins From:'s not to be shown */
- X! char page_header[LEN+1]; /* page header of pgm name and version */
- X! char savedir[LEN+1]; /* directory to save articles to */
- X! char spooldir[LEN+1]; /* directory where new is */
- X! char mailer[LEN+1]; /* mail program */
- X! char maildir[LEN+1]; /* mailbox dir where = saves are stored */
- X! char mailbox[LEN+1]; /* system mailbox for each user */
- X! char printer[LEN+1]; /* printer program */
- X! char article[LEN+1]; /* ~/.article file */
- X! char dead_article[LEN+1]; /* ~/dead.article file */
- X! char progname[LEN+1]; /* program name */
- X int sort_art_type; /* sort arts[] array by subject,from or date field */
- X int save_separate; /* save a each part of a thread to a separate file */
- X int save_archive_name; /* save thread with name from Archive-name: field */
- X--- 19,57 ----
- X char *mailbox_name = (char *) 0;
- X int mailbox_size;
- X
- X! char rcdir[LEN];
- X! char rcfile[LEN];
- X! char indexdir[LEN];
- X! char killfile[LEN];
- X! char postfile[LEN];
- X! char unthreadfile[LEN];
- X
- X! char active_file[LEN];
- X! char homedir[LEN];
- X! char userid[LEN];
- X! char delgroups[LEN];
- X! char newsrc[LEN];
- X! char newnewsrc[LEN];
- X! char add_addr[LEN]; /* address to add to rR reply to author with mail */
- X! char bug_addr[LEN]; /* address to add send bug reports to */
- X! char txt_help_bug_report[LEN]; /* address to add send bug reports to */
- X! char reply_to[LEN]; /* reply-to address */
- X! char my_org[LEN]; /* organization */
- X! char sig[LEN];
- X! char signature[LEN];
- X! char default_shell_command[LEN]; /* offers user default choice */
- X! char killsubj[LEN]; /* contains Subject:'s not to be shown */
- X! char killfrom[LEN]; /* conatins From:'s not to be shown */
- X! char page_header[LEN]; /* page header of pgm name and version */
- X! char savedir[LEN]; /* directory to save articles to */
- X! char spooldir[LEN]; /* directory where new is */
- X! char mailer[LEN]; /* mail program */
- X! char maildir[LEN]; /* mailbox dir where = saves are stored */
- X! char mailbox[LEN]; /* system mailbox for each user */
- X! char printer[LEN]; /* printer program */
- X! char article[LEN]; /* ~/.article file */
- X! char dead_article[LEN]; /* ~/dead.article file */
- X! char progname[LEN]; /* program name */
- X int sort_art_type; /* sort arts[] array by subject,from or date field */
- X int save_separate; /* save a each part of a thread to a separate file */
- X int save_archive_name; /* save thread with name from Archive-name: field */
- X***************
- X*** 62,67 ****
- X--- 64,70 ----
- X int post_proc_type; /* type of post processing to be performed */
- X int default_printer; /* set to false if user give a printer with -p switch */
- X int save_news; /* save all arts to savedir structure */
- X+ int thread_arts; /* thread/unthread articles for viewing */
- X int num_of_tagged_files;
- X
- X /*
- X***************
- X*** 72,78 ****
- X
- X void init_selfinfo ()
- X {
- X! char nam[LEN+1];
- X char *p;
- X extern char *getenv();
- X extern struct passwd *getpwuid();
- X--- 75,81 ----
- X
- X void init_selfinfo ()
- X {
- X! char nam[LEN];
- X char *p;
- X extern char *getenv();
- X extern struct passwd *getpwuid();
- X***************
- X*** 110,115 ****
- X--- 113,119 ----
- X show_author = TRUE;
- X sort_art_type = SORT_BY_NOTHING;
- X save_news = FALSE;
- X+ thread_arts = TRUE;
- X
- X killsubj[0] = '\0';
- X killfrom[0] = '\0';
- X***************
- X*** 122,127 ****
- X--- 126,132 ----
- X default_mail_address[0] = '\0';
- X default_regex_pattern[0] = '\0';
- X default_save_file[0] = '\0';
- X+ default_shell_command[0] = '\0';
- X
- X sprintf (rcdir, "%s/%s", get_val ("TINDIR", homedir), RCDIR);
- X sprintf (indexdir, "%s/%s", rcdir, INDEXDIR);
- X***************
- X*** 128,133 ****
- X--- 133,139 ----
- X sprintf (rcfile, "%s/%s", rcdir, RCFILE);
- X sprintf (killfile, "%s/%s", rcdir, KILLFILE);
- X sprintf (postfile, "%s/%s", rcdir, POSTFILE);
- X+ sprintf (unthreadfile, "%s/%s", rcdir, UNTHREADFILE);
- X
- X sprintf (signature, "%s/.signature", homedir);
- X sprintf (sig, "%s/.Sig", homedir);
- X***************
- X*** 159,164 ****
- X--- 165,175 ----
- X fclose (fp);
- X }
- X }
- X+ if (stat (unthreadfile, &sb) == -1) {
- X+ if ((fp = fopen (unthreadfile, "w")) != NULL) {
- X+ fclose (fp);
- X+ }
- X+ }
- X
- X read_rcfile ();
- X
- X***************
- X*** 333,339 ****
- X register int i, j;
- X
- X for (i = 0; i < top_base; i++) {
- X! for (j = base[i] ; j >= 0 ; j = arts[j].thread) {
- X if (j == n) {
- X return i;
- X }
- X--- 344,350 ----
- X register int i, j;
- X
- X for (i = 0; i < top_base; i++) {
- X! for (j = (int) base[i] ; j >= 0 ; j = arts[j].thread) {
- X if (j == n) {
- X return i;
- X }
- X***************
- X*** 356,362 ****
- X
- X i = which_base (n);
- X
- X! for (j = base[i]; j != -1; j = arts[j].thread)
- X if (j == n)
- X break;
- X else
- X--- 367,373 ----
- X
- X i = which_base (n);
- X
- X! for (j = (int) base[i]; j != -1; j = arts[j].thread)
- X if (j == n)
- X break;
- X else
- X***************
- X*** 377,387 ****
- X int oldi = -3;
- X int sum = 0;
- X
- X! assert(n < top_base);
- X
- X! for (i = base[n]; i != -1; i = arts[i].thread) {
- X! assert(i != -2);
- X! assert(i != oldi);
- X oldi = i;
- X sum++;
- X }
- X--- 388,398 ----
- X int oldi = -3;
- X int sum = 0;
- X
- X! assert (n < top_base);
- X
- X! for (i = (int) base[n]; i != -1; i = arts[i].thread) {
- X! assert (i != -2);
- X! assert (i != oldi);
- X oldi = i;
- X sum++;
- X }
- X***************
- X*** 429,436 ****
- X int invoke_editor (nam)
- X char *nam;
- X {
- X! char buf[LEN+1];
- X! static char editor[LEN+1];
- X static int first = TRUE;
- X
- X if (first) {
- X--- 440,447 ----
- X int invoke_editor (nam)
- X char *nam;
- X {
- X! char buf[LEN];
- X! static char editor[LEN];
- X static int first = TRUE;
- X
- X if (first) {
- X***************
- X*** 451,457 ****
- X
- X void shell_escape ()
- X {
- X! char shell[LEN+1];
- X char *p;
- X
- X #ifdef SIGTSTP
- X--- 462,468 ----
- X
- X void shell_escape ()
- X {
- X! char shell[LEN];
- X char *p;
- X
- X #ifdef SIGTSTP
- X***************
- X*** 458,478 ****
- X void (*susp)();
- X #endif
- X
- X! if (! parse_string (txt_shell_escape, shell))
- X strcpy (shell, get_val ("SHELL", DEFAULT_SHELL));
- X
- X for (p = shell; *p && (*p == ' ' || *p == '\t'); p++)
- X continue;
- X
- X! if (! *p)
- X! strcpy (shell, get_val ("SHELL", DEFAULT_SHELL));
- X
- X Raw (FALSE);
- X
- X set_real_uid_gid ();
- X
- X- fputs ("\r\n", stdout);
- X-
- X #ifdef SIGTSTP
- X if (do_sigtstp)
- X susp = signal (SIGTSTP, SIG_DFL);
- X--- 469,502 ----
- X void (*susp)();
- X #endif
- X
- X! sprintf (msg, txt_shell_escape, default_shell_command);
- X!
- X! if (! parse_string (msg, shell))
- X strcpy (shell, get_val ("SHELL", DEFAULT_SHELL));
- X
- X for (p = shell; *p && (*p == ' ' || *p == '\t'); p++)
- X continue;
- X
- X! if (*p) {
- X! my_strncpy (default_shell_command, p, LEN);
- X! } else {
- X! if (default_shell_command[0]) {
- X! my_strncpy (shell, default_shell_command, LEN);
- X! } else {
- X! strcpy (shell, get_val ("SHELL", DEFAULT_SHELL));
- X! }
- X! p = shell;
- X! }
- X!
- X! ClearScreen ();
- X! sprintf (msg, "Shell Command (%s)", p);
- X! center_line (0, TRUE, msg);
- X! MoveCursor (INDEX_TOP, 0);
- X
- X Raw (FALSE);
- X
- X set_real_uid_gid ();
- X
- X #ifdef SIGTSTP
- X if (do_sigtstp)
- X susp = signal (SIGTSTP, SIG_DFL);
- X***************
- X*** 502,512 ****
- X void tin_done (ret)
- X int ret;
- X {
- X nntp_finish (); /* disconnect from NNTP server */
- X free_all_arrays (); /* deallocate all arrays */
- X! ClearScreen();
- X! Raw(FALSE);
- X! exit(ret);
- X }
- X
- X /*
- X--- 526,568 ----
- X void tin_done (ret)
- X int ret;
- X {
- X+ char group_path[LEN], *p;
- X+ int ask = TRUE;
- X+ register int i, j;
- X+
- X+ /*
- X+ * check if any groups were read & ask if they should marked read
- X+ */
- X+ for (i = 0 ; i < local_top ; i++) {
- X+ if (active[my_group[i]].read) {
- X+ if (ask) {
- X+ if (prompt_yn (LINES, "Catchup all groups entered during this session? (y/n): ", 'n')) {
- X+ ask = FALSE;
- X+ thread_arts = FALSE; /* speeds up index loading */
- X+ } else {
- X+ break;
- X+ }
- X+ }
- X+ sprintf (msg, "Catchup %s...", active[my_group[i]].name);
- X+ wait_message (msg);
- X+ strcpy (group_path, active[my_group[i]].name);
- X+ for (p = group_path; *p; p++) {
- X+ if (*p == '.') {
- X+ *p = '/';
- X+ }
- X+ }
- X+ index_group (active[my_group[i]].name, group_path);
- X+ for (j = 0; j < top; j++) {
- X+ arts[j].unread = ART_READ;
- X+ }
- X+ update_newsrc (active[my_group[i]].name, my_group[i], FALSE);
- X+ }
- X+ }
- X nntp_finish (); /* disconnect from NNTP server */
- X free_all_arrays (); /* deallocate all arrays */
- X! ClearScreen ();
- X! Raw (FALSE);
- X! exit (ret);
- X }
- X
- X /*
- X***************
- X*** 517,523 ****
- X {
- X FILE *fp;
- X char *p, *q;
- X! char buf[LEN+1];
- X int created, i;
- X long h;
- X
- X--- 573,579 ----
- X {
- X FILE *fp;
- X char *p, *q;
- X! char buf[LEN];
- X int created, i;
- X long h;
- X
- X***************
- X*** 571,578 ****
- X active[num_active].name = str_dup (buf);
- X active[num_active].max = (long) atol (p);
- X active[num_active].min = (long) atol (q);
- X! active[num_active].next = -1; /* hash chaining */
- X! active[num_active].flag = NOTGOT; /* not in my_group[] yet */
- X
- X num_active++;
- X
- X--- 627,636 ----
- X active[num_active].name = str_dup (buf);
- X active[num_active].max = (long) atol (p);
- X active[num_active].min = (long) atol (q);
- X! active[num_active].next = -1; /* hash chaining */
- X! active[num_active].flag = NOTGOT; /* not in my_group[] yet */
- X! active[num_active].read = FALSE; /* read/unread */
- X! active[num_active].thread = TRUE; /* thread articles */
- X
- X num_active++;
- X
- X***************
- X*** 594,632 ****
- X */
- X created = backup_active (TRUE);
- X
- X- #ifdef SORT_ACTIVE_FILE /* DOES NOT WORK - ERROR */
- X- if (num_active) {
- X- qsort (active, num_active, sizeof (struct group_ent), active_comp);
- X- }
- X- #endif
- X-
- X debug_print_active ();
- X
- X return (created);
- X }
- X
- X!
- X! #ifdef SORT_ACTIVE_FILE /* DOES NOT WORK - ERROR */
- X! int active_comp (p1, p2)
- X! char *p1;
- X! char *p2;
- X! {
- X! struct group_ent *s1 = (struct group_ent *) p1;
- X! struct group_ent *s2 = (struct group_ent *) p2;
- X
- X! /* s1->name less than s2->name */
- X! if (strcmp (s1->name, s2->name) < 0) {
- X! return -1;
- X }
- X! /* s1->name greater than s2->name */
- X! if (strcmp (s1->name, s2->name) > 0) {
- X! return 1;
- X }
- X! return 0;
- X }
- X- #endif
- X
- X-
- X /*
- X * create ~/.tin/active from LIBDIR/active if it does not exist
- X */
- X--- 652,701 ----
- X */
- X created = backup_active (TRUE);
- X
- X debug_print_active ();
- X
- X return (created);
- X }
- X
- X! /*
- X! * Mark any groups in my_group[] that are in ~/.tin/unthread so they
- X! * will not be threaded
- X! */
- X
- X! void mark_unthreaded_groups ()
- X! {
- X! FILE *fp;
- X! char buf[LEN];
- X! int i;
- X! long h;
- X!
- X! if ((fp = fopen (unthreadfile, "r")) == NULL) {
- X! error_message (txt_cannot_open, unthreadfile);
- X! return;
- X }
- X!
- X! while (fgets (buf, sizeof (buf), fp) != NULL) {
- X! buf[strlen (buf)-1] = '\0';
- X! h = hash_groupname (buf);
- X!
- X! if (debug) {
- X! printf ("Unthreading %s...\n", buf);
- X! }
- X!
- X! if ((i = group_hash[h]) >= 0) {
- X! active[i].thread = FALSE;
- X! } else {
- X! for (i=group_hash[h]; active[i].next >= 0; i=active[i].next) {
- X! if (strcmp (active[i].name, buf) == 0) {
- X! active[i].thread = FALSE;
- X! break;
- X! }
- X! }
- X! }
- X }
- X! fclose (fp);
- X }
- X
- X /*
- X * create ~/.tin/active from LIBDIR/active if it does not exist
- X */
- X***************
- X*** 693,699 ****
- X char *path;
- X int mode;
- X {
- X! char buf[LEN+1];
- X struct stat sb;
- X
- X sprintf(buf, "mkdir %s", path);
- X--- 762,768 ----
- X char *path;
- X int mode;
- X {
- X! char buf[LEN];
- X struct stat sb;
- X
- X sprintf(buf, "mkdir %s", path);
- X***************
- X*** 812,826 ****
- X
- X void set_real_uid_gid ()
- X {
- X! setuid (real_uid);
- X! setgid (real_gid);
- X }
- X
- X
- X void set_tin_uid_gid ()
- X {
- X! setuid (tin_uid);
- X! setgid (tin_gid);
- X }
- X
- X
- X--- 881,903 ----
- X
- X void set_real_uid_gid ()
- X {
- X! if (setuid (real_uid) == -1) {
- X! error_message ("Error setuid(real) failed", (char *) 0);
- X! }
- X! if (setgid (real_gid) == -1) {
- X! error_message ("Error setgid(real) failed", (char *) 0);
- X! }
- X }
- X
- X
- X void set_tin_uid_gid ()
- X {
- X! if (setuid (tin_uid) == -1) {
- X! error_message ("Error setuid(tin) failed", (char *) 0);
- X! }
- X! if (setgid (tin_gid) == -1) {
- X! error_message ("Error setgid(tin) failed", (char *) 0);
- X! }
- X }
- X
- X
- X***************
- X*** 848,857 ****
- X
- X Raw (FALSE);
- X
- X! printf ("Checking for new newsgroups...");
- X fflush (stdout);
- X
- X! old_active = (struct notify_t *) my_malloc (sizeof (struct notify_t) * num_active);
- X if (old_active == (struct notify_t *) 0) {
- X error_message (txt_out_of_memory, progname);
- X goto notify_groups_done;
- X--- 925,934 ----
- X
- X Raw (FALSE);
- X
- X! printf ("Checking active list for new newsgroups...");
- X fflush (stdout);
- X
- X! old_active = (struct notify_t *) my_malloc ((unsigned) sizeof (struct notify_t) * num_active);
- X if (old_active == (struct notify_t *) 0) {
- X error_message (txt_out_of_memory, progname);
- X goto notify_groups_done;
- X***************
- X*** 913,929 ****
- X }
- X
- X
- X! void basename (dirname, basename)
- X char *dirname; /* argv[0] */
- X! char *basename; /* progname is returned */
- X {
- X int i;
- X
- X! strcpy (basename, dirname);
- X
- X! for (i=(int) strlen(dirname)-1 ; i ; i--) {
- X if (dirname[i] == '/') {
- X! strcpy (basename, dirname+(i+1));
- X break;
- X }
- X }
- X--- 990,1006 ----
- X }
- X
- X
- X! void basename (dirname, program)
- X char *dirname; /* argv[0] */
- X! char *program; /* progname is returned */
- X {
- X int i;
- X
- X! strcpy (program, dirname);
- X
- X! for (i=(int) strlen (dirname)-1 ; i ; i--) {
- X if (dirname[i] == '/') {
- X! strcpy (program, dirname+(i+1));
- X break;
- X }
- X }
- Xdiff -rcs 102/newsrc.c 103/newsrc.c
- X*** 102/newsrc.c Mon Sep 23 17:55:39 1991
- X--- 103/newsrc.c Mon Sep 30 14:49:05 1991
- X***************
- X*** 3,9 ****
- X * Module : newsrc.c
- X * Author : R.Skrenta / I.Lea
- X * Created : 01-04-91
- X! * Updated : 23-09-91
- X * Release : 1.0
- X * Notes :
- X * Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
- X--- 3,9 ----
- X * Module : newsrc.c
- X * Author : R.Skrenta / I.Lea
- X * Created : 01-04-91
- X! * Updated : 30-09-91
- X * Release : 1.0
- X * Notes :
- X * Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
- X***************
- X*** 26,34 ****
- X FILE *fp_newsrc, *fp_backup;
- X
- X set_real_uid_gid ();
- X!
- X if ((fp_newsrc = fopen (newsrc, "r")) != NULL) {
- X sprintf (buf, "%s/.oldnewsrc", homedir);
- X if ((fp_backup = fopen (buf, "w")) != NULL) {
- X while (fgets (buf, sizeof (buf), fp_newsrc) != NULL) {
- X fputs (buf, fp_backup);
- X--- 26,35 ----
- X FILE *fp_newsrc, *fp_backup;
- X
- X set_real_uid_gid ();
- X!
- X if ((fp_newsrc = fopen (newsrc, "r")) != NULL) {
- X sprintf (buf, "%s/.oldnewsrc", homedir);
- X+ unlink (buf); /* because rn make link of .newsrc -> .oldnewsrc */
- X if ((fp_backup = fopen (buf, "w")) != NULL) {
- X while (fgets (buf, sizeof (buf), fp_newsrc) != NULL) {
- X fputs (buf, fp_backup);
- X***************
- X*** 154,160 ****
- X
- X void rewrite_newsrc ()
- X {
- X! char buf[8192], old[LEN+1];
- X char old_groups[LEN];
- X FILE *fp, *fp_old, *fp_new;
- X int found_old_group, len;
- X--- 155,161 ----
- X
- X void rewrite_newsrc ()
- X {
- X! char buf[8192], old[LEN];
- X char old_groups[LEN];
- X FILE *fp, *fp_old, *fp_new;
- X int found_old_group, len;
- X***************
- X*** 181,187 ****
- X strncmp (buf, old, len) == 0) {
- X old[len] = '\0';
- X fprintf (stderr, txt_not_in_active_file, old);
- X! fprintf (stderr, ". Deleting.\n");
- X fflush (stderr);
- X found_old_group = TRUE;
- X }
- X--- 182,188 ----
- X strncmp (buf, old, len) == 0) {
- X old[len] = '\0';
- X fprintf (stderr, txt_not_in_active_file, old);
- X! fprintf (stderr, ". Deleting.\r\n");
- X fflush (stderr);
- X found_old_group = TRUE;
- X }
- Xdiff -rcs 102/nntp.h 103/nntp.h
- X*** 102/nntp.h Mon Sep 23 17:55:39 1991
- X--- 103/nntp.h Mon Sep 30 07:58:07 1991
- X***************
- X*** 3,9 ****
- X * Module : nntp.h
- X * Author : R.Skrenta
- X * Created : 01-04-91
- X! * Updated : 10-08-91
- X * Release : 1.0
- X * Notes : Changed a bit so nntp knows about Tass
- X * This file is originally from the nntp 1.5 source.
- X--- 3,9 ----
- X * Module : nntp.h
- X * Author : R.Skrenta
- X * Created : 01-04-91
- X! * Updated : 27-09-91
- X * Release : 1.0
- X * Notes : Changed a bit so nntp knows about Tass
- X * This file is originally from the nntp 1.5 source.
- X***************
- X*** 14,20 ****
- X--- 14,22 ----
- X * right notice, and it must be included in any copy made
- X */
- X
- X+ #ifndef NNTP_SERVER_FILE
- X #define NNTP_SERVER_FILE "/etc/nntpserver"
- X+ #endif
- X
- X /*
- X * External routine declarations
- Xdiff -rcs 102/open.c 103/open.c
- X*** 102/open.c Mon Sep 23 17:55:39 1991
- X--- 103/open.c Mon Sep 30 18:44:17 1991
- X***************
- X*** 3,9 ****
- X * Module : open.c
- X * Author : R.Skrenta / I.Lea
- X * Created : 01-04-91
- X! * Updated : 28-08-91
- X * Release : 1.0
- X * Notes : reads news locally (/usr/spool/news) or via NNTP
- X * Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
- X--- 3,9 ----
- X * Module : open.c
- X * Author : R.Skrenta / I.Lea
- X * Created : 01-04-91
- X! * Updated : 27-09-91
- X * Release : 1.0
- X * Notes : reads news locally (/usr/spool/news) or via NNTP
- X * Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
- X***************
- X*** 46,52 ****
- X int compiled_with_nntp = FALSE;
- X #endif
- X
- X! char server_name[LEN+1];
- X
- X
- X char *is_remote ()
- X--- 46,52 ----
- X int compiled_with_nntp = FALSE;
- X #endif
- X
- X! char server_name[LEN];
- X
- X
- X char *is_remote ()
- X***************
- X*** 74,98 ****
- X void nntp_startup ()
- X {
- X #ifdef USE_NNTP
- X! char *server_name;
- X int ret;
- X extern char *getenv();
- X
- X if (read_news_via_nntp) {
- X if (nntp_server[0]) {
- X! server_name = nntp_server;
- X } else {
- X! server_name = getserverbyfile (NNTP_SERVER_FILE);
- X }
- X! if (server_name == NULL) {
- X fprintf(stderr, txt_cannot_get_nntp_server_name);
- X fprintf(stderr, txt_server_name_in_file_env_var, NNTP_SERVER_FILE);
- X exit(1);
- X }
- X
- X! ret = server_init (server_name);
- X /*
- X! handle_server_response (ret, server_name);
- X */
- X switch (ret) {
- X case OK_CANPOST:
- X--- 74,101 ----
- X void nntp_startup ()
- X {
- X #ifdef USE_NNTP
- X! char *server;
- X int ret;
- X extern char *getenv();
- X
- X if (read_news_via_nntp) {
- X if (nntp_server[0]) {
- X! server = nntp_server;
- X } else {
- X! server = getserverbyfile (NNTP_SERVER_FILE);
- X }
- X! if (server == (char *) 0) {
- X fprintf(stderr, txt_cannot_get_nntp_server_name);
- X fprintf(stderr, txt_server_name_in_file_env_var, NNTP_SERVER_FILE);
- X exit(1);
- X }
- X
- X! wait_message ("Connecting...");
- X!
- X! ret = server_init (server);
- X! putchar ('\n');
- X /*
- X! handle_server_response (ret, server);
- X */
- X switch (ret) {
- X case OK_CANPOST:
- X***************
- X*** 100,106 ****
- X break;
- X
- X case -1:
- X! fprintf (stderr, txt_failed_to_connect_to_server, server_name);
- X exit (1);
- X
- X default:
- X--- 103,109 ----
- X break;
- X
- SHAR_EOF
- echo "End of tin1.0 part 2"
- echo "File tin.patch03 is continued in part 3"
- echo "3" > shar3_seq_.tmp
- exit 0
-
- exit 0 # Just in case...
- --
- Kent Landfield INTERNET: kent@sparky.IMD.Sterling.COM
- Sterling Software, IMD UUCP: uunet!sparky!kent
- Phone: (402) 291-8300 FAX: (402) 291-4362
- Please send comp.sources.misc-related mail to kent@uunet.uu.net.
-