home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume31 / tin / patch05f < prev    next >
Encoding:
Text File  |  1992-08-16  |  60.5 KB  |  2,483 lines

  1. Newsgroups: comp.sources.misc
  2. From: iain%anl433.uucp@Germany.EU.net (Iain Lea)
  3. Subject:  v31i085:  tin - threaded full screen newsreader v1.1, Patch05f/7
  4. Message-ID: <1992Aug16.012743.12875@sparky.imd.sterling.com>
  5. X-Md4-Signature: 8abe47c4b713f9c28961df79a6347391
  6. Date: Sun, 16 Aug 1992 01:27:43 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: iain%anl433.uucp@Germany.EU.net (Iain Lea)
  10. Posting-number: Volume 31, Issue 85
  11. Archive-name: tin/patch05f
  12. Environment: BSD, SCO, ISC, SUNOS, SYSVR3, SYSVR4, ULTRIX, XENIX
  13. Patch-To: tin: Volume 31, Issue 1-15
  14.  
  15. #!/bin/sh
  16. # this is patch-1.15.shar.06 (part 6 of tin-1.15)
  17. # do not concatenate these parts, unpack them in order with /bin/sh
  18. # file tin-1.15.patch continued
  19. #
  20. if test ! -r _shar_seq_.tmp; then
  21.     echo 'Please unpack part 1 first!'
  22.     exit 1
  23. fi
  24. (read Scheck
  25.  if test "$Scheck" != 6; then
  26.     echo Please unpack part "$Scheck" next!
  27.     exit 1
  28.  else
  29.     exit 0
  30.  fi
  31. ) < _shar_seq_.tmp || exit 1
  32. if test ! -f _shar_wnt_.tmp; then
  33.     echo 'x - still skipping tin-1.15.patch'
  34. else
  35. echo 'x - continuing file tin-1.15.patch'
  36. sed 's/^X//' << 'SHAR_EOF' >> 'tin-1.15.patch' &&
  37. *** 560,576 ****
  38. X                  break;
  39. X  
  40. X              case 15:
  41. !                 var_orig = sort_art_type;
  42. X                  show_menu_help (txt_help_sort_type);
  43. X                  do {
  44. X                      MoveCursor (INDEX_TOP+10, COL1 + (int) strlen (txt_opt_sort_type));
  45. X                      if ((ch    = ReadCh()) == ' ') {
  46. !                         if (sort_art_type + 1 > SORT_BY_DATE_ASCEND) {
  47. !                             sort_art_type = SORT_BY_NOTHING;
  48. X                          } else {
  49. !                             sort_art_type++;
  50. X                          }
  51. !                         switch (sort_art_type) {
  52. X                              case SORT_BY_NOTHING:
  53. X                                  str = txt_sort_by_nothing;
  54. X                                  break;
  55. --- 639,655 ----
  56. X                  break;
  57. X  
  58. X              case 15:
  59. !                 var_orig = default_sort_art_type;
  60. X                  show_menu_help (txt_help_sort_type);
  61. X                  do {
  62. X                      MoveCursor (INDEX_TOP+10, COL1 + (int) strlen (txt_opt_sort_type));
  63. X                      if ((ch    = ReadCh()) == ' ') {
  64. !                         if (default_sort_art_type + 1 > SORT_BY_DATE_ASCEND) {
  65. !                             default_sort_art_type = SORT_BY_NOTHING;
  66. X                          } else {
  67. !                             default_sort_art_type++;
  68. X                          }
  69. !                         switch (default_sort_art_type) {
  70. X                              case SORT_BY_NOTHING:
  71. X                                  str = txt_sort_by_nothing;
  72. X                                  break;
  73. ***************
  74. *** 600,607 ****
  75. X                  } while (ch != CR && ch != ESC);
  76. X  
  77. X                  if (ch == ESC) {    /* restore original value */
  78. !                     sort_art_type = var_orig;
  79. !                     switch (sort_art_type) {
  80. X                          case SORT_BY_NOTHING:
  81. X                              str = txt_sort_by_nothing;
  82. X                              break;
  83. --- 679,686 ----
  84. X                  } while (ch != CR && ch != ESC);
  85. X  
  86. X                  if (ch == ESC) {    /* restore original value */
  87. !                     default_sort_art_type = var_orig;
  88. !                     switch (default_sort_art_type) {
  89. X                          case SORT_BY_NOTHING:
  90. X                              str = txt_sort_by_nothing;
  91. X                              break;
  92. ***************
  93. *** 662,671 ****
  94. X      center_line (0, TRUE, txt_options_menu);
  95. X      
  96. X      MoveCursor (INDEX_TOP, 0);
  97. !     printf ("%s%s\r\n\r\n", txt_opt_autosave, (save_archive_name ? "ON " : "OFF"));
  98. X      printf ("%s%s\r\n\r\n", txt_opt_confirm_action, (confirm_action ? "ON " : "OFF"));
  99. X      printf ("%s%s\r\n\r\n", txt_opt_pos_first_unread, (pos_first_unread ? "ON " : "OFF"));
  100. !     printf ("%s%s", txt_opt_thread_arts, (thread_arts ? "ON " : "OFF"));
  101. X  
  102. X      MoveCursor(INDEX_TOP, COL2);
  103. X      printf ("%s%s", txt_opt_start_editor_offset, (start_editor_offset ? "ON " : "OFF"));
  104. --- 741,750 ----
  105. X      center_line (0, TRUE, txt_options_menu);
  106. X      
  107. X      MoveCursor (INDEX_TOP, 0);
  108. !     printf ("%s%s\r\n\r\n", txt_opt_autosave, (default_auto_save ? "ON " : "OFF"));
  109. X      printf ("%s%s\r\n\r\n", txt_opt_confirm_action, (confirm_action ? "ON " : "OFF"));
  110. X      printf ("%s%s\r\n\r\n", txt_opt_pos_first_unread, (pos_first_unread ? "ON " : "OFF"));
  111. !     printf ("%s%s", txt_opt_thread_arts, (default_thread_arts ? "ON " : "OFF"));
  112. X  
  113. X      MoveCursor(INDEX_TOP, COL2);
  114. X      printf ("%s%s", txt_opt_start_editor_offset, (start_editor_offset ? "ON " : "OFF"));
  115. ***************
  116. *** 674,680 ****
  117. X      MoveCursor(INDEX_TOP+4, COL2);
  118. X      printf ("%s%s", txt_opt_page_scroll, (full_page_scroll ? "ON " : "OFF"));
  119. X      MoveCursor(INDEX_TOP+6, COL2);
  120. !     printf ("%s%s", txt_opt_show_only_unread, (show_only_unread ? "ON " : "OFF"));
  121. X  
  122. X      MoveCursor(INDEX_TOP, COL3);
  123. X      printf ("%s%s", txt_opt_mark_saved_read, (mark_saved_read ? "ON " : "OFF"));
  124. --- 753,759 ----
  125. X      MoveCursor(INDEX_TOP+4, COL2);
  126. X      printf ("%s%s", txt_opt_page_scroll, (full_page_scroll ? "ON " : "OFF"));
  127. X      MoveCursor(INDEX_TOP+6, COL2);
  128. !     printf ("%s%s", txt_opt_show_only_unread, (default_show_only_unread ? "ON " : "OFF"));
  129. X  
  130. X      MoveCursor(INDEX_TOP, COL3);
  131. X      printf ("%s%s", txt_opt_mark_saved_read, (mark_saved_read ? "ON " : "OFF"));
  132. ***************
  133. *** 686,692 ****
  134. X      printf ("%s%s", txt_opt_show_description, (show_description ? "ON " : "OFF"));
  135. X  
  136. X      MoveCursor(INDEX_TOP+8, COL1);
  137. !     switch (show_author) {
  138. X          case SHOW_FROM_NONE:
  139. X              str = txt_show_from_none;
  140. X              break;
  141. --- 765,771 ----
  142. X      printf ("%s%s", txt_opt_show_description, (show_description ? "ON " : "OFF"));
  143. X  
  144. X      MoveCursor(INDEX_TOP+8, COL1);
  145. !     switch (default_show_author) {
  146. X          case SHOW_FROM_NONE:
  147. X              str = txt_show_from_none;
  148. X              break;
  149. ***************
  150. *** 702,708 ****
  151. X      }
  152. X      printf ("%s%s", txt_opt_show_author, str);
  153. X      MoveCursor(INDEX_TOP+8, COL2);
  154. !     switch (post_proc_type) {
  155. X          case POST_PROC_NONE:
  156. X              str = txt_post_process_none;
  157. X              break;
  158. --- 781,787 ----
  159. X      }
  160. X      printf ("%s%s", txt_opt_show_author, str);
  161. X      MoveCursor(INDEX_TOP+8, COL2);
  162. !     switch (default_post_proc_type) {
  163. X          case POST_PROC_NONE:
  164. X              str = txt_post_process_none;
  165. X              break;
  166. ***************
  167. *** 723,729 ****
  168. X      printf ("%s%s\r\n\r\n", txt_opt_process_type, str);
  169. X      
  170. X      MoveCursor(INDEX_TOP+10, COL1);
  171. !     switch (sort_art_type) {
  172. X          case SORT_BY_NOTHING:
  173. X              str = txt_sort_by_nothing;
  174. X              break;
  175. --- 802,808 ----
  176. X      printf ("%s%s\r\n\r\n", txt_opt_process_type, str);
  177. X      
  178. X      MoveCursor(INDEX_TOP+10, COL1);
  179. !     switch (default_sort_art_type) {
  180. X          case SORT_BY_NOTHING:
  181. X              str = txt_sort_by_nothing;
  182. X              break;
  183. ***************
  184. *** 841,843 ****
  185. --- 920,955 ----
  186. X      return FALSE;
  187. X  }
  188. X  
  189. + /*
  190. +  *  convert underlines to spaces in a string
  191. +  */
  192. + void quote_dash_to_space (s)
  193. +     char *s;
  194. + {
  195. +     int i;
  196. +     for (i=0 ; i < strlen (s) ; i++) {
  197. +         if (s[i] == '_') {
  198. +             s[i] = ' ';
  199. +         }
  200. +     }
  201. + }
  202. + /*
  203. +  *  convert spaces to underlines in a string
  204. +  */
  205. + char *quote_space_to_dash (s)
  206. +     char *s;
  207. + {
  208. +     int i;
  209. +     static char ds[PATH_LEN];
  210. +     for (i=0 ; i < strlen (s) ; i++) {
  211. +         (s[i] == ' ') ? (ds[i] = '_') : (ds[i] = s[i]);
  212. +     }    
  213. +     ds[i] = '\0';
  214. +     return ds;
  215. + }
  216. diff -rcs ../1.14/save.c ./save.c
  217. *** ../1.14/save.c    Tue Aug 11 21:23:20 1992
  218. --- ./save.c    Thu Jul 23 08:26:19 1992
  219. ***************
  220. *** 3,9 ****
  221. X   *  Module    : save.c
  222. X   *  Author    : I.Lea & R.Skrenta
  223. X   *  Created   : 01-04-91
  224. !  *  Updated   : 09-05-92
  225. X   *  Notes     :
  226. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  227. X   *              You may  freely  copy or  redistribute  this software,
  228. --- 3,9 ----
  229. X   *  Module    : save.c
  230. X   *  Author    : I.Lea & R.Skrenta
  231. X   *  Created   : 01-04-91
  232. !  *  Updated   : 23-07-92
  233. X   *  Notes     :
  234. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  235. X   *              You may  freely  copy or  redistribute  this software,
  236. ***************
  237. *** 22,33 ****
  238. X  extern int cur_groupnum;
  239. X  
  240. X  int create_subdir = TRUE;
  241. - int save_num=0;
  242. - int max_save;
  243. X  
  244. - struct save_t *save;
  245. X  
  246. X  /*
  247. X   * types of archive programs
  248. X   * 0=archiver, 1=extension, 2=extract option, 3=list option
  249. --- 22,29 ----
  250. ***************
  251. *** 79,85 ****
  252. X      char group_path[LEN];
  253. X      char savefile[LEN];
  254. X      extern FILE *note_fp;
  255. !     FILE *fp;
  256. X      FILE *fp_log = (FILE *) 0;
  257. X      int i, j, print_group;
  258. X      int check_arts = 0;
  259. --- 75,81 ----
  260. X      char group_path[LEN];
  261. X      char savefile[LEN];
  262. X      extern FILE *note_fp;
  263. !     FILE *fp = (FILE *) 0; 
  264. X      FILE *fp_log = (FILE *) 0;
  265. X      int i, j, print_group;
  266. X      int check_arts = 0;
  267. ***************
  268. *** 155,166 ****
  269. X                                  create_path (buf);
  270. X                              }
  271. X                          }
  272. -                         sprintf (buf, "[%5ld]  %s\n", arts[j].artnum, arts[j].subject);
  273. -                         fprintf (fp_log, "%s", buf);
  274. -                         if (verbose) {
  275. -                             wait_message (buf);
  276. -                         }
  277. -                         saved_arts++;
  278. X  
  279. X                          if (check_start_save == MAIL_ANY_NEWS) {
  280. X                              sprintf (savefile, "/tmp/tin.%d", process_id);
  281. --- 151,156 ----
  282. ***************
  283. *** 169,174 ****
  284. --- 159,172 ----
  285. X                                       group_path, arts[j].artnum);
  286. X                          }
  287. X  
  288. +                         if (check_start_save == MAIL_ANY_NEWS) {
  289. +                             fprintf (fp, "To: %s\n", mail_news_user);
  290. +                         }
  291. +                         note_page = art_open (arts[j].artnum, group_path);    
  292. +                         if (note_page == ART_UNAVAILABLE) {
  293. +                             continue;
  294. +                         }
  295. X                          if ((fp = fopen (savefile, "w")) == NULL) {
  296. X                              fprintf (fp_log, txt_cannot_open, savefile);
  297. X                              if (verbose) {
  298. ***************
  299. *** 176,191 ****
  300. X                              }
  301. X                              continue;
  302. X                          }
  303. !                 
  304. !                         if (check_start_save == MAIL_ANY_NEWS) {
  305. !                             fprintf (fp, "To: %s\n", mail_news_user);
  306. X                          }
  307. -                         note_page = art_open (arts[j].artnum, group_path);    
  308. X                          fseek (note_fp, 0L, 0);
  309. X                          copy_fp (note_fp, fp, "");
  310. X                          art_close ();
  311. X                          fclose (fp);
  312. X  
  313. X                          if (check_start_save == MAIL_ANY_NEWS) {
  314. X                              sprintf (buf, "%s \"%s\" < %s", mailer,
  315. --- 174,189 ----
  316. X                              }
  317. X                              continue;
  318. X                          }
  319. !                         sprintf (buf, "[%5ld]  %s\n", arts[j].artnum, arts[j].subject);
  320. !                         fprintf (fp_log, "%s", buf);
  321. !                         if (verbose) {
  322. !                             wait_message (buf);
  323. X                          }
  324. X                          fseek (note_fp, 0L, 0);
  325. X                          copy_fp (note_fp, fp, "");
  326. X                          art_close ();
  327. X                          fclose (fp);
  328. +                         saved_arts++;
  329. X  
  330. X                          if (check_start_save == MAIL_ANY_NEWS) {
  331. X                              sprintf (buf, "%s \"%s\" < %s", mailer,
  332. ***************
  333. *** 285,291 ****
  334. X          my_strncpy (file, filename, sizeof (file));
  335. X          is_mailbox = mailbox;
  336. X          i = index;
  337. !     } else if (save_archive_name && arts[respnum].archive) {
  338. X          my_strncpy (file, arts[respnum].archive, sizeof (file));
  339. X      }
  340. X  
  341. --- 283,289 ----
  342. X          my_strncpy (file, filename, sizeof (file));
  343. X          is_mailbox = mailbox;
  344. X          i = index;
  345. !     } else if (default_auto_save && arts[respnum].archive) {
  346. X          my_strncpy (file, arts[respnum].archive, sizeof (file));
  347. X      }
  348. X  
  349. ***************
  350. *** 342,348 ****
  351. X      int count = 0;
  352. X      int i, ret_code = FALSE;
  353. X  
  354. !     for (i=0 ; i < save_num ; i++) {
  355. X          sprintf (msg, "%s%d", txt_saving, ++count);
  356. X          wait_message (msg);
  357. X  
  358. --- 340,346 ----
  359. X      int count = 0;
  360. X      int i, ret_code = FALSE;
  361. X  
  362. !     for (i=0 ; i < num_save ; i++) {
  363. X          sprintf (msg, "%s%d", txt_saving, ++count);
  364. X          wait_message (msg);
  365. X  
  366. ***************
  367. *** 353,360 ****
  368. X          }
  369. X  
  370. X          note_page = art_open (arts[save[i].index].artnum, group_path);
  371. !         ret_code = save_art_to_file (save[i].index, i, is_mailbox, file);
  372. !         art_close ();            
  373. X      }
  374. X      
  375. X      first_savefile = get_first_savefile ();
  376. --- 351,360 ----
  377. X          }
  378. X  
  379. X          note_page = art_open (arts[save[i].index].artnum, group_path);
  380. !         if (note_page != ART_UNAVAILABLE) {
  381. !             ret_code = save_art_to_file (save[i].index, i, is_mailbox, file);
  382. !             art_close ();            
  383. !         }
  384. X      }
  385. X      
  386. X      first_savefile = get_first_savefile ();
  387. ***************
  388. *** 365,371 ****
  389. X          if (is_mailbox) {
  390. X              sprintf (save_thread_info, txt_saved_to_mailbox, first_savefile);
  391. X          } else {
  392. !             if (save_num == 1) {
  393. X                  sprintf (save_thread_info, txt_art_saved_to, first_savefile);
  394. X              } else {
  395. X                  sprintf (save_thread_info, txt_thread_saved_to_many,
  396. --- 365,371 ----
  397. X          if (is_mailbox) {
  398. X              sprintf (save_thread_info, txt_saved_to_mailbox, first_savefile);
  399. X          } else {
  400. !             if (num_save == 1) {
  401. X                  sprintf (save_thread_info, txt_art_saved_to, first_savefile);
  402. X              } else {
  403. X                  sprintf (save_thread_info, txt_thread_saved_to_many,
  404. ***************
  405. *** 395,401 ****
  406. X      char buf[PATH_LEN];
  407. X      int i, ret_code = FALSE;     
  408. X      
  409. !     for (i=0 ; i < save_num ; i++) {
  410. X          sprintf(msg, "%s%d", txt_saving, i+1);
  411. X          wait_message (msg);
  412. X  
  413. --- 395,401 ----
  414. X      char buf[PATH_LEN];
  415. X      int i, ret_code = FALSE;     
  416. X      
  417. !     for (i=0 ; i < num_save ; i++) {
  418. X          sprintf(msg, "%s%d", txt_saving, i+1);
  419. X          wait_message (msg);
  420. X  
  421. ***************
  422. *** 406,416 ****
  423. X          }
  424. X  
  425. X          note_page = art_open (arts[save[i].index].artnum, group_path);
  426. !         ret_code = save_art_to_file (save[i].index, i, is_mailbox, buf);
  427. !         art_close ();            
  428. X      }
  429. X  
  430. !     if (! save_num) {    
  431. X          info_message (txt_no_match);
  432. X      } else {
  433. X          if (is_mailbox) {
  434. --- 406,418 ----
  435. X          }
  436. X  
  437. X          note_page = art_open (arts[save[i].index].artnum, group_path);
  438. !         if (note_page != ART_UNAVAILABLE) {
  439. !             ret_code = save_art_to_file (save[i].index, i, is_mailbox, buf);
  440. !             art_close ();            
  441. !         }
  442. X      }
  443. X  
  444. !     if (! num_save) {    
  445. X          info_message (txt_no_match);
  446. X      } else {
  447. X          if (is_mailbox) {
  448. ***************
  449. *** 602,629 ****
  450. X      dir[0] = '\0';
  451. X      file[0] = '\0';
  452. X  
  453. !     if (save_num == max_save-1) {
  454. X          expand_save ();
  455. X      }
  456. X  
  457. !     save[save_num].index   = index;
  458. !     save[save_num].saved   = FALSE;
  459. !     save[save_num].is_mailbox = is_mailbox;
  460. !     save[save_num].dir     = (char *) 0;
  461. !     save[save_num].file    = (char *) 0;
  462. !     save[save_num].archive = (char *) 0;
  463. !     save[save_num].part    = (char *) 0;
  464. !     save[save_num].patch   = (char *) 0;
  465. X  
  466. !     save[save_num].subject = str_dup (article->subject);
  467. X      if (article->archive) {
  468. !         save[save_num].archive = str_dup (article->archive);
  469. X      }
  470. X      if (article->part) {
  471. !         save[save_num].part = str_dup (article->part);
  472. X      }
  473. X      if (article->patch) {
  474. !         save[save_num].patch = str_dup (article->patch);
  475. X      }
  476. X  
  477. X      if (is_mailbox) {
  478. --- 604,631 ----
  479. X      dir[0] = '\0';
  480. X      file[0] = '\0';
  481. X  
  482. !     if (num_save == max_save-1) {
  483. X          expand_save ();
  484. X      }
  485. X  
  486. !     save[num_save].index   = index;
  487. !     save[num_save].saved   = FALSE;
  488. !     save[num_save].is_mailbox = is_mailbox;
  489. !     save[num_save].dir     = (char *) 0;
  490. !     save[num_save].file    = (char *) 0;
  491. !     save[num_save].archive = (char *) 0;
  492. !     save[num_save].part    = (char *) 0;
  493. !     save[num_save].patch   = (char *) 0;
  494. X  
  495. !     save[num_save].subject = str_dup (article->subject);
  496. X      if (article->archive) {
  497. !         save[num_save].archive = str_dup (article->archive);
  498. X      }
  499. X      if (article->part) {
  500. !         save[num_save].part = str_dup (article->part);
  501. X      }
  502. X      if (article->patch) {
  503. !         save[num_save].patch = str_dup (article->patch);
  504. X      }
  505. X  
  506. X      if (is_mailbox) {
  507. ***************
  508. *** 636,643 ****
  509. X          } else {
  510. X              my_strncpy (file, glob_group, sizeof (file));
  511. X          }
  512. !         save[save_num].dir = str_dup (active[my_group[cur_groupnum]].attribute.maildir);
  513. !         save[save_num].file = str_dup (file);
  514. X      } else {
  515. X          if (path[0]) {
  516. X              for (i=strlen (path) ; i ; i--) {
  517. --- 638,645 ----
  518. X          } else {
  519. X              my_strncpy (file, glob_group, sizeof (file));
  520. X          }
  521. !         save[num_save].dir = str_dup (active[my_group[cur_groupnum]].attribute.maildir);
  522. !         save[num_save].file = str_dup (file);
  523. X      } else {
  524. X          if (path[0]) {
  525. X              for (i=strlen (path) ; i ; i--) {
  526. ***************
  527. *** 651,672 ****
  528. X          }
  529. X          
  530. X          if (dir[0]) {
  531. !             save[save_num].dir = str_dup (dir);
  532. X          } else {
  533. !             save[save_num].dir = str_dup (active[my_group[cur_groupnum]].attribute.savedir);
  534. X          }
  535. X  
  536. X          if (file[0]) {
  537. !             save[save_num].file = str_dup (file);
  538. X          } else {
  539. X              if (path[0]) {
  540. !                 save[save_num].file = str_dup (path);
  541. X              } else {
  542. !                 save[save_num].file = str_dup (save[save_num].archive);
  543. X              }
  544. X          }
  545. X      }
  546. !     save_num++;
  547. X  
  548. X  #endif /* INDEX_DAEMON */
  549. X  }
  550. --- 653,674 ----
  551. X          }
  552. X          
  553. X          if (dir[0]) {
  554. !             save[num_save].dir = str_dup (dir);
  555. X          } else {
  556. !             save[num_save].dir = str_dup (active[my_group[cur_groupnum]].attribute.savedir);
  557. X          }
  558. X  
  559. X          if (file[0]) {
  560. !             save[num_save].file = str_dup (file);
  561. X          } else {
  562. X              if (path[0]) {
  563. !                 save[num_save].file = str_dup (path);
  564. X              } else {
  565. !                 save[num_save].file = str_dup (save[num_save].archive);
  566. X              }
  567. X          }
  568. X      }
  569. !     num_save++;
  570. X  
  571. X  #endif /* INDEX_DAEMON */
  572. X  }
  573. ***************
  574. *** 677,683 ****
  575. X  
  576. X  void sort_save_list ()
  577. X  {
  578. !     qsort ((char *) save, save_num, sizeof (struct save_t), save_comp);
  579. X  }
  580. X  
  581. X  /*
  582. --- 679,686 ----
  583. X  
  584. X  void sort_save_list ()
  585. X  {
  586. !     qsort ((char *) save, num_save, sizeof (struct save_t), save_comp);
  587. !     debug_save_comp ();
  588. X  }
  589. X  
  590. X  /*
  591. ***************
  592. *** 697,702 ****
  593. --- 700,729 ----
  594. X       */
  595. X      if (s1->archive != (char *) 0) {
  596. X          if (s1->part != (char *) 0) {
  597. +             if (s2->part != (char *) 0) {
  598. +                 if (strcmp (s1->part, s2->part) < 0) {
  599. +                     return -1;
  600. +                 }
  601. +                 if (strcmp (s1->part, s2->part) > 0) {
  602. +                     return 1;
  603. +                 }
  604. +             } else {
  605. +                 return 0;
  606. +             }    
  607. +         } else if (s1->patch != (char *) 0) {
  608. +             if (s2->patch != (char *) 0) {
  609. +                 if (strcmp (s1->patch, s2->patch) < 0) {
  610. +                     return -1;
  611. +                 }
  612. +                 if (strcmp (s1->patch, s2->patch) > 0) {
  613. +                     return 1;
  614. +                 }
  615. +             } else {
  616. +                 return 0;
  617. +             }    
  618. +         }    
  619. + #if 0
  620. +         if (s1->part != (char *) 0) {
  621. X              if (strcmp (s1->part, s2->part) < 0) {
  622. X                  return -1;
  623. X              }
  624. ***************
  625. *** 711,716 ****
  626. --- 738,744 ----
  627. X                  return 1;
  628. X              }
  629. X          }    
  630. + #endif
  631. X      } else {
  632. X          if (strcmp (s1->subject, s2->subject) < 0) {
  633. X              return -1;
  634. ***************
  635. *** 736,743 ****
  636. X          return (filename);
  637. X      }
  638. X      
  639. !     if (! save_archive_name || (! save[i].part && ! save[i].patch)) {
  640. !         if (save_num == 1) {
  641. X              sprintf (filename, "%s/%s", save[i].dir, save[i].file);
  642. X          } else {
  643. X              sprintf (filename, "%s/%s.%02d", save[i].dir, save[i].file, i+1);
  644. --- 764,771 ----
  645. X          return (filename);
  646. X      }
  647. X      
  648. !     if (! default_auto_save || (! save[i].part && ! save[i].patch)) {
  649. !         if (num_save == 1) {
  650. X              sprintf (filename, "%s/%s", save[i].dir, save[i].file);
  651. X          } else {
  652. X              sprintf (filename, "%s/%s.%02d", save[i].dir, save[i].file, i+1);
  653. ***************
  654. *** 771,777 ****
  655. X      char *file;
  656. X      int i;
  657. X  
  658. !     for (i=0 ; i < save_num ; i++) {
  659. X          if (save[i].saved) {
  660. X              file = (char *) my_malloc (PATH_LEN);
  661. X              if (save[i].is_mailbox) {
  662. --- 799,805 ----
  663. X      char *file;
  664. X      int i;
  665. X  
  666. !     for (i=0 ; i < num_save ; i++) {
  667. X          if (save[i].saved) {
  668. X              file = (char *) my_malloc (PATH_LEN);
  669. X              if (save[i].is_mailbox) {
  670. ***************
  671. *** 778,784 ****
  672. X                  sprintf (file, "%s/%s", save[i].dir, save[i].file);
  673. X                  return (file);
  674. X              } else {
  675. !                 if (save[i].archive && save_archive_name) {
  676. X                      if (save[i].part) {
  677. X                          if (create_subdir) {
  678. X                              sprintf (file, "%s/%s.%s%s", save[i].archive, save[i].archive, LONG_PATH_PART, save[i].part);
  679. --- 806,812 ----
  680. X                  sprintf (file, "%s/%s", save[i].dir, save[i].file);
  681. X                  return (file);
  682. X              } else {
  683. !                 if (save[i].archive && default_auto_save) {
  684. X                      if (save[i].part) {
  685. X                          if (create_subdir) {
  686. X                              sprintf (file, "%s/%s.%s%s", save[i].archive, save[i].archive, LONG_PATH_PART, save[i].part);
  687. ***************
  688. *** 793,799 ****
  689. X                          }
  690. X                      }
  691. X                  } else {
  692. !                     if (save_num == 1) {
  693. X                          sprintf (file, "%s", save[i].file);
  694. X                      } else {
  695. X                          sprintf (file, "%s.%02d", save[i].file, i+1);
  696. --- 821,827 ----
  697. X                          }
  698. X                      }
  699. X                  } else {
  700. !                     if (num_save == 1) {
  701. X                          sprintf (file, "%s", save[i].file);
  702. X                      } else {
  703. X                          sprintf (file, "%s.%02d", save[i].file, i+1);
  704. ***************
  705. *** 812,818 ****
  706. X      char *file;
  707. X      int i;
  708. X      
  709. !     for (i=save_num-1 ; i >= 0 ; i--) {
  710. X          if (save[i].saved) {
  711. X              file = (char *) my_malloc (PATH_LEN);
  712. X              if (save[i].is_mailbox) {
  713. --- 840,846 ----
  714. X      char *file;
  715. X      int i;
  716. X      
  717. !     for (i=num_save-1 ; i >= 0 ; i--) {
  718. X          if (save[i].saved) {
  719. X              file = (char *) my_malloc (PATH_LEN);
  720. X              if (save[i].is_mailbox) {
  721. ***************
  722. *** 819,825 ****
  723. X                  sprintf (file, "%s/%s", save[i].dir, save[i].file);
  724. X                  return (file);
  725. X              } else {
  726. !                 if (save[i].archive && save_archive_name) {
  727. X                      if (save[i].part) {
  728. X                          if (create_subdir) {
  729. X                              sprintf (file, "%s/%s.%s%s", save[i].archive, save[i].archive, LONG_PATH_PART, save[i].part);
  730. --- 847,853 ----
  731. X                  sprintf (file, "%s/%s", save[i].dir, save[i].file);
  732. X                  return (file);
  733. X              } else {
  734. !                 if (save[i].archive && default_auto_save) {
  735. X                      if (save[i].part) {
  736. X                          if (create_subdir) {
  737. X                              sprintf (file, "%s/%s.%s%s", save[i].archive, save[i].archive, LONG_PATH_PART, save[i].part);
  738. ***************
  739. *** 834,840 ****
  740. X                          }
  741. X                      }
  742. X                  } else {
  743. !                     if (save_num == 1) {
  744. X                          sprintf (file, "%s", save[i].file);
  745. X                      } else {
  746. X                          sprintf (file, "%s.%02d", save[i].file, i+1);
  747. --- 862,868 ----
  748. X                          }
  749. X                      }
  750. X                  } else {
  751. !                     if (num_save == 1) {
  752. X                          sprintf (file, "%s", save[i].file);
  753. X                      } else {
  754. X                          sprintf (file, "%s.%02d", save[i].file, i+1);
  755. ***************
  756. *** 851,857 ****
  757. X  int post_process_files (proc_type_ch)
  758. X      char proc_type_ch;
  759. X  {
  760. !     if (save_num) {
  761. X          wait_message (txt_post_processing);
  762. X  
  763. X          switch (proc_type_ch) {
  764. --- 879,885 ----
  765. X  int post_process_files (proc_type_ch)
  766. X      char proc_type_ch;
  767. X  {
  768. !     if (num_save) {
  769. X          wait_message (txt_post_processing);
  770. X  
  771. X          switch (proc_type_ch) {
  772. ***************
  773. *** 864,870 ****
  774. X                  break;
  775. X  
  776. X              case 'U':
  777. !                 if (post_proc_type == POST_PROC_UUD_EXT_ZOO) {
  778. X                      post_process_uud (POST_PROC_UUD_EXT_ZOO);
  779. X                  } else {
  780. X                      post_process_uud (POST_PROC_UUD_LST_ZOO);
  781. --- 892,898 ----
  782. X                  break;
  783. X  
  784. X              case 'U':
  785. !                 if (default_post_proc_type == POST_PROC_UUD_EXT_ZOO) {
  786. X                      post_process_uud (POST_PROC_UUD_EXT_ZOO);
  787. X                  } else {
  788. X                      post_process_uud (POST_PROC_UUD_LST_ZOO);
  789. ***************
  790. *** 913,919 ****
  791. X      }
  792. X  
  793. X  
  794. !     for (i=0 ; i < save_num ; i++) {
  795. X          my_strncpy (buf, save_filename (i), sizeof (buf));
  796. X  
  797. X          if ((fp_in = fopen (buf, "r")) != NULL) {
  798. --- 941,947 ----
  799. X      }
  800. X  
  801. X  
  802. !     for (i=0 ; i < num_save ; i++) {
  803. X          my_strncpy (buf, save_filename (i), sizeof (buf));
  804. X  
  805. X          if ((fp_in = fopen (buf, "r")) != NULL) {
  806. ***************
  807. *** 1086,1092 ****
  808. X  
  809. X      sprintf (file_out, "%s/tin.%05d", file_out_dir, process_id);
  810. X  
  811. !     for (j=0 ; j < save_num ; j++) {
  812. X          my_strncpy (file_in, save_filename (j), sizeof (file_in));
  813. X  
  814. X          printf (txt_extracting_shar, file_in);
  815. --- 1114,1120 ----
  816. X  
  817. X      sprintf (file_out, "%s/tin.%05d", file_out_dir, process_id);
  818. X  
  819. !     for (j=0 ; j < num_save ; j++) {
  820. X          my_strncpy (file_in, save_filename (j), sizeof (file_in));
  821. X  
  822. X          printf (txt_extracting_shar, file_in);
  823. ***************
  824. *** 1173,1179 ****
  825. X      if (prompt_yn (LINES, txt_delete_processed_files, 'y')) {
  826. X          wait_message (txt_deleting);
  827. X  
  828. !         for (i=0 ; i < save_num ; i++) {
  829. X              unlink (save_filename (i));
  830. X          }
  831. X      }
  832. --- 1201,1207 ----
  833. X      if (prompt_yn (LINES, txt_delete_processed_files, 'y')) {
  834. X          wait_message (txt_deleting);
  835. X  
  836. !         for (i=0 ; i < num_save ; i++) {
  837. X              unlink (save_filename (i));
  838. X          }
  839. X      }
  840. diff -rcs ../1.14/screen.c ./screen.c
  841. *** ../1.14/screen.c    Tue Aug 11 21:23:21 1992
  842. --- ./screen.c    Mon Jul 20 12:51:09 1992
  843. ***************
  844. *** 56,62 ****
  845. X          fflush (stderr);
  846. X      } else {
  847. X          MoveCursor (LINES, 0);
  848. !         sleep (2);
  849. X      }
  850. X  }
  851. X  
  852. --- 56,62 ----
  853. X          fflush (stderr);
  854. X      } else {
  855. X          MoveCursor (LINES, 0);
  856. !         sleep (3);
  857. X      }
  858. X  }
  859. X  
  860. ***************
  861. *** 65,76 ****
  862. X      char *template;
  863. X      char *str;
  864. X  {
  865. X      char str2[512];
  866. X  
  867. X      clear_message ();      /* Clear any old messages hanging around */
  868. !     
  869. X      sprintf (str2, template, str);
  870. X      perror (str2);
  871. X      errno = 0;
  872. X  
  873. X      if (cmd_line) {
  874. --- 65,84 ----
  875. X      char *template;
  876. X      char *str;
  877. X  {
  878. +     extern char *sys_errlist[];
  879. X      char str2[512];
  880. +     int err = 0;
  881. +     
  882. +     err = errno;
  883. X  
  884. X      clear_message ();      /* Clear any old messages hanging around */
  885. X      sprintf (str2, template, str);
  886. + /*    
  887. X      perror (str2);
  888. + */
  889. +     err = errno;
  890. +     fprintf (stderr, "%s: %s", str2, sys_errlist[err]);
  891. X      errno = 0;
  892. X  
  893. X      if (cmd_line) {
  894. ***************
  895. *** 78,84 ****
  896. X          fflush (stderr);
  897. X      } else {
  898. X          MoveCursor (LINES, 0);
  899. !         sleep (2);
  900. X      }
  901. X  }
  902. X  
  903. --- 86,92 ----
  904. X          fflush (stderr);
  905. X      } else {
  906. X          MoveCursor (LINES, 0);
  907. !         sleep (3);
  908. X      }
  909. X  }
  910. X  
  911. diff -rcs ../1.14/search.c ./search.c
  912. *** ../1.14/search.c    Tue Aug 11 21:23:22 1992
  913. --- ./search.c    Fri Jul 24 21:00:05 1992
  914. ***************
  915. *** 3,9 ****
  916. X   *  Module    : search.c
  917. X   *  Author    : I.Lea & R.Skrenta
  918. X   *  Created   : 01-04-91
  919. !  *  Updated   : 13-03-92
  920. X   *  Notes     :
  921. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  922. X   *              You may  freely  copy or  redistribute  this software,
  923. --- 3,9 ----
  924. X   *  Module    : search.c
  925. X   *  Author    : I.Lea & R.Skrenta
  926. X   *  Created   : 01-04-91
  927. !  *  Updated   : 24-07-92
  928. X   *  Notes     :
  929. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  930. X   *              You may  freely  copy or  redistribute  this software,
  931. ***************
  932. *** 40,47 ****
  933. X   *  group.c & page.c
  934. X   */
  935. X   
  936. ! int search_author (only_unread, current_art, forward)
  937. !     int only_unread;
  938. X      int current_art;
  939. X      int forward;
  940. X  {
  941. --- 40,47 ----
  942. X   *  group.c & page.c
  943. X   */
  944. X   
  945. ! int search_author (index, current_art, forward)
  946. !     int index;
  947. X      int current_art;
  948. X      int forward;
  949. X  {
  950. ***************
  951. *** 92,98 ****
  952. X                      num_of_responses (top_base - 1);
  953. X          }
  954. X  
  955. !         if (only_unread && arts[i].unread != ART_UNREAD) {
  956. X              continue;
  957. X          }
  958. X              
  959. --- 92,99 ----
  960. X                      num_of_responses (top_base - 1);
  961. X          }
  962. X  
  963. !         if (active[index].attribute.show_only_unread && 
  964. !             arts[i].unread != ART_UNREAD) {
  965. X              continue;
  966. X          }
  967. X              
  968. diff -rcs ../1.14/select.c ./select.c
  969. *** ../1.14/select.c    Tue Aug 11 21:23:23 1992
  970. --- ./select.c    Tue Jul 28 07:10:01 1992
  971. ***************
  972. *** 3,9 ****
  973. X   *  Module    : select.c
  974. X   *  Author    : I.Lea & R.Skrenta
  975. X   *  Created   : 01-04-91
  976. !  *  Updated   : 18-06-92
  977. X   *  Notes     :
  978. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  979. X   *              You may  freely  copy or  redistribute  this software,
  980. --- 3,9 ----
  981. X   *  Module    : select.c
  982. X   *  Author    : I.Lea & R.Skrenta
  983. X   *  Created   : 01-04-91
  984. !  *  Updated   : 27-07-92
  985. X   *  Notes     :
  986. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  987. X   *              You may  freely  copy or  redistribute  this software,
  988. ***************
  989. *** 57,68 ****
  990. X      set_alarm_signal ();        /* set alarm signal for resync_active_file () */
  991. X      
  992. X      while (TRUE) {
  993. ! #ifndef NO_RESYNC_ACTIVE_FILE
  994. X          resync_active_file ();    /* reread active file if alarm set */
  995. X  #endif
  996. X          ch = ReadCh ();
  997. ! #ifndef NO_RESYNC_ACTIVE_FILE
  998. !         resync_active_file ();    /* reread active file if alarm set */
  999. X  #endif
  1000. X  
  1001. X          if (ch > '0' && ch <= '9') {
  1002. --- 57,69 ----
  1003. X      set_alarm_signal ();        /* set alarm signal for resync_active_file () */
  1004. X      
  1005. X      while (TRUE) {
  1006. ! #ifndef NO_REREAD_ACTIVE_FILE
  1007. X          resync_active_file ();    /* reread active file if alarm set */
  1008. X  #endif
  1009. X          ch = ReadCh ();
  1010. ! #ifndef NO_REREAD_ACTIVE_FILE
  1011. !         if (ch != 'q' && ch != 'Q')
  1012. !             resync_active_file ();
  1013. X  #endif
  1014. X  
  1015. X          if (ch > '0' && ch <= '9') {
  1016. ***************
  1017. *** 151,157 ****
  1018. X                          n = my_group[cur_groupnum];
  1019. X                          group_page (active[n].name);
  1020. X                      } while (index_point == -3);
  1021. ! #ifndef NO_RESYNC_ACTIVE_FILE                    
  1022. X                      if (! reread_active_file)
  1023. X  #endif                    
  1024. X                          group_selection_page ();
  1025. --- 152,158 ----
  1026. X                          n = my_group[cur_groupnum];
  1027. X                          group_page (active[n].name);
  1028. X                      } while (index_point == -3);
  1029. ! #ifndef NO_REREAD_ACTIVE_FILE                    
  1030. X                      if (! reread_active_file)
  1031. X  #endif                    
  1032. X                          group_selection_page ();
  1033. ***************
  1034. *** 217,228 ****
  1035. X                  sprintf (msg, txt_del_group_in_newsrc, buf);
  1036. X                  if (prompt_yn (LINES, msg, 'y')) {
  1037. X                      delete_group (active[my_group[cur_groupnum]].name);
  1038. !                     active[my_group[cur_groupnum]].flag = UNSUBSCRIBED;    
  1039. X  
  1040. X                      group_top--;
  1041. X                      for (i = cur_groupnum; i < group_top; i++) {
  1042. X                          my_group[i] = my_group[i+1];
  1043. -                         unread[i] = unread[i+1];
  1044. X                      }
  1045. X                      if (cur_groupnum >= group_top)
  1046. X                          cur_groupnum = group_top - 1;    
  1047. --- 218,232 ----
  1048. X                  sprintf (msg, txt_del_group_in_newsrc, buf);
  1049. X                  if (prompt_yn (LINES, msg, 'y')) {
  1050. X                      delete_group (active[my_group[cur_groupnum]].name);
  1051. !                     active[my_group[cur_groupnum]].my_group = UNSUBSCRIBED;    
  1052. X  
  1053. X                      group_top--;
  1054. X                      for (i = cur_groupnum; i < group_top; i++) {
  1055. + #if 0
  1056. +                         active[my_group[i]].unread = 
  1057. +                             active[my_group[i+1]].unread;
  1058. + #endif                            
  1059. X                          my_group[i] = my_group[i+1];
  1060. X                      }
  1061. X                      if (cur_groupnum >= group_top)
  1062. X                          cur_groupnum = group_top - 1;    
  1063. ***************
  1064. *** 374,380 ****
  1065. X  
  1066. X              case 'g':    /* prompt for a new group name */
  1067. X                  if ((n = choose_new_group ()) >= 0) {
  1068. !                     if (active[my_group[n]].flag != SUBSCRIBED) {
  1069. X                          subscribe (active[my_group[n]].name, ':',
  1070. X                              my_group[n], FALSE);
  1071. X                      }
  1072. --- 378,384 ----
  1073. X  
  1074. X              case 'g':    /* prompt for a new group name */
  1075. X                  if ((n = choose_new_group ()) >= 0) {
  1076. !                     if (active[my_group[n]].my_group != SUBSCRIBED) {
  1077. X                          subscribe (active[my_group[n]].name, ':',
  1078. X                              my_group[n], FALSE);
  1079. X                      }
  1080. ***************
  1081. *** 411,417 ****
  1082. X                  break;
  1083. X  
  1084. X              case 'm':    /* reposition group within group list */
  1085. !                 if (active[my_group[cur_groupnum]].flag == SUBSCRIBED) {
  1086. X                      n = cur_groupnum;
  1087. X                      cur_groupnum = reposition_group (active[my_group[n]].name, n);
  1088. X                      if (cur_groupnum < first_group_on_screen ||
  1089. --- 415,421 ----
  1090. X                  break;
  1091. X  
  1092. X              case 'm':    /* reposition group within group list */
  1093. !                 if (active[my_group[cur_groupnum]].my_group == SUBSCRIBED) {
  1094. X                      n = cur_groupnum;
  1095. X                      cur_groupnum = reposition_group (active[my_group[n]].name, n);
  1096. X                      if (cur_groupnum < first_group_on_screen ||
  1097. ***************
  1098. *** 432,437 ****
  1099. --- 436,443 ----
  1100. X              case 'M':    /* options menu */
  1101. X                  set_alarm_clock_off ();
  1102. X                  change_rcfile ("", TRUE);
  1103. +                 free_attributes_array ();
  1104. +                 read_attributes_file ();
  1105. X                  group_selection_page ();
  1106. X                  set_alarm_clock_on ();
  1107. X                  break;
  1108. ***************
  1109. *** 441,456 ****
  1110. X                  break;
  1111. X  
  1112. X              case 'q':    /* quit */
  1113. !             case 'Q':    /* quit */
  1114. X                  write_rcfile ();
  1115. X                  tin_done (0);
  1116. X                  break;
  1117. X  
  1118. X              case 's':    /* subscribe to current group */
  1119. X                  if (group_top == 0) {
  1120. X                      break;
  1121. X                  }
  1122. !                 if (active[my_group[cur_groupnum]].flag != SUBSCRIBED) {
  1123. X                      MoveCursor (INDEX_TOP + (cur_groupnum-first_group_on_screen), 2);
  1124. X                      if (draw_arrow_mark) {
  1125. X                          fputc (' ', stdout);
  1126. --- 447,474 ----
  1127. X                  break;
  1128. X  
  1129. X              case 'q':    /* quit */
  1130. !             case 'Q':
  1131. X                  write_rcfile ();
  1132. X                  tin_done (0);
  1133. X                  break;
  1134. X  
  1135. +             case 'r':
  1136. +                  /* 
  1137. +                   * If in show_only_unread_groups mode toggle
  1138. +                   * all subscribed to groups and only  groups
  1139. +                   * that contain unread articles
  1140. +                   */
  1141. +                  show_only_unread_groups = !show_only_unread_groups;
  1142. +                 toggle_my_groups (show_only_unread_groups);
  1143. +                 set_groupname_len (FALSE);
  1144. +                 group_selection_page ();
  1145. +                 break;
  1146. X              case 's':    /* subscribe to current group */
  1147. X                  if (group_top == 0) {
  1148. X                      break;
  1149. X                  }
  1150. !                 if (active[my_group[cur_groupnum]].my_group != SUBSCRIBED) {
  1151. X                      MoveCursor (INDEX_TOP + (cur_groupnum-first_group_on_screen), 2);
  1152. X                      if (draw_arrow_mark) {
  1153. X                          fputc (' ', stdout);
  1154. ***************
  1155. *** 478,484 ****
  1156. X  #else        
  1157. X                          if (wildmat (active[my_group[i]].name, buf)) {
  1158. X  #endif        
  1159. !                                 if (active[my_group[i]].flag != SUBSCRIBED) {
  1160. X  #ifndef SLOW_SCREEN_UPDATE
  1161. X                                  sprintf (msg, txt_subscribing_to, active[my_group[i]].name);
  1162. X                                  wait_message (msg);
  1163. --- 496,502 ----
  1164. X  #else        
  1165. X                          if (wildmat (active[my_group[i]].name, buf)) {
  1166. X  #endif        
  1167. !                                 if (active[my_group[i]].my_group != SUBSCRIBED) {
  1168. X  #ifndef SLOW_SCREEN_UPDATE
  1169. X                                  sprintf (msg, txt_subscribing_to, active[my_group[i]].name);
  1170. X                                  wait_message (msg);
  1171. ***************
  1172. *** 505,511 ****
  1173. X                  if (group_top == 0) {
  1174. X                      break;
  1175. X                  }
  1176. !                 if (active[my_group[cur_groupnum]].flag == SUBSCRIBED) {
  1177. X                      MoveCursor(INDEX_TOP + (cur_groupnum-first_group_on_screen), 2);
  1178. X                      if (draw_arrow_mark) {
  1179. X                          fputc ('u', stdout);
  1180. --- 523,529 ----
  1181. X                  if (group_top == 0) {
  1182. X                      break;
  1183. X                  }
  1184. !                 if (active[my_group[cur_groupnum]].my_group == SUBSCRIBED) {
  1185. X                      MoveCursor(INDEX_TOP + (cur_groupnum-first_group_on_screen), 2);
  1186. X                      if (draw_arrow_mark) {
  1187. X                          fputc ('u', stdout);
  1188. ***************
  1189. *** 533,539 ****
  1190. X  #else        
  1191. X                          if (wildmat (active[my_group[i]].name, buf)) {
  1192. X  #endif        
  1193. !                                 if (active[my_group[i]].flag == SUBSCRIBED) {
  1194. X  #ifndef SLOW_SCREEN_UPDATE
  1195. X                                  sprintf (msg, txt_unsubscribing_from, active[my_group[i]].name);
  1196. X                                  wait_message (msg);
  1197. --- 551,557 ----
  1198. X  #else        
  1199. X                          if (wildmat (active[my_group[i]].name, buf)) {
  1200. X  #endif        
  1201. !                                 if (active[my_group[i]].my_group == SUBSCRIBED) {
  1202. X  #ifndef SLOW_SCREEN_UPDATE
  1203. X                                  sprintf (msg, txt_unsubscribing_from, active[my_group[i]].name);
  1204. X                                  wait_message (msg);
  1205. ***************
  1206. *** 588,603 ****
  1207. X              case 'y':    /* pull in rest of groups from active */
  1208. X                  if (yank_active_file) {
  1209. X                      wait_message (txt_yanking_all_groups);
  1210. X                      n = group_top;
  1211. X                      for (i = 0; i < num_active; i++) {
  1212. !                         active[i].flag = UNSUBSCRIBED;
  1213. X                      }
  1214. X                      read_newsrc (FALSE);
  1215. X                      for (i = 0; i < num_active; i++) {
  1216. !                         if (active[i].flag & UNSUBSCRIBED) {
  1217. !                             active[i].flag &= ~UNSUBSCRIBED;
  1218. X                              my_group[group_top] = i;
  1219. -                             unread[group_top] = -1;
  1220. X                              group_top++;
  1221. X                          }
  1222. X                      }
  1223. --- 606,622 ----
  1224. X              case 'y':    /* pull in rest of groups from active */
  1225. X                  if (yank_active_file) {
  1226. X                      wait_message (txt_yanking_all_groups);
  1227. +                     set_alarm_clock_off ();
  1228. X                      n = group_top;
  1229. X                      for (i = 0; i < num_active; i++) {
  1230. !                         active[i].my_group = UNSUBSCRIBED;
  1231. X                      }
  1232. X                      read_newsrc (FALSE);
  1233. X                      for (i = 0; i < num_active; i++) {
  1234. !                         if (active[i].my_group & UNSUBSCRIBED) {
  1235. !                             active[i].my_group &= ~UNSUBSCRIBED;
  1236. !                             active[i].unread = -1;
  1237. X                              my_group[group_top] = i;
  1238. X                              group_top++;
  1239. X                          }
  1240. X                      }
  1241. ***************
  1242. *** 618,623 ****
  1243. --- 637,643 ----
  1244. X                      set_groupname_len (yank_active_file);
  1245. X                      group_selection_page ();
  1246. X                      yank_active_file = TRUE;
  1247. +                     set_alarm_clock_on ();
  1248. X                  }
  1249. X                  break;
  1250. X  
  1251. ***************
  1252. *** 636,643 ****
  1253. X                  group_top = 0;
  1254. X                  read_newsrc (TRUE);            
  1255. X                  cur_groupnum = n;
  1256. !                 if (unread[cur_groupnum]) {
  1257. !                     sprintf (msg, "%5d", unread[cur_groupnum]);
  1258. X                  } else {    
  1259. X                      strcpy (msg, "     ");
  1260. X                  }
  1261. --- 656,663 ----
  1262. X                  group_top = 0;
  1263. X                  read_newsrc (TRUE);            
  1264. X                  cur_groupnum = n;
  1265. !                 if (active[my_group[cur_groupnum]].unread) {
  1266. !                     sprintf (msg, "%5d", active[my_group[cur_groupnum]].unread);
  1267. X                  } else {    
  1268. X                      strcpy (msg, "     ");
  1269. X                  }
  1270. ***************
  1271. *** 687,695 ****
  1272. X  #endif
  1273. X  
  1274. X      if (xspooldir_supported) {
  1275. !         sprintf (buf, "%s (%s  %d)", txt_group_selection, spooldir_alias, group_top);
  1276. X      } else {
  1277. !         sprintf (buf, "%s (%d)", txt_group_selection, group_top);
  1278. X      }    
  1279. X      show_title (buf);
  1280. X  
  1281. --- 707,718 ----
  1282. X  #endif
  1283. X  
  1284. X      if (xspooldir_supported) {
  1285. !         sprintf (buf, "%s (%s  %d%s)", 
  1286. !             txt_group_selection, spooldir_alias, group_top,
  1287. !             (show_only_unread_groups ? " R" : ""));
  1288. X      } else {
  1289. !         sprintf (buf, "%s (%d%s)", txt_group_selection, group_top,
  1290. !             (show_only_unread_groups ? " R" : ""));
  1291. X      }    
  1292. X      show_title (buf);
  1293. X  
  1294. ***************
  1295. *** 739,746 ****
  1296. X  
  1297. X      blank_len = (COLS - (groupname_len + SELECT_MISC_COLS)) + 2;
  1298. X      
  1299. !     for (j=0, i = first_group_on_screen; i < last_group_on_screen; i++,j++) {
  1300. !         switch (unread[i]) {
  1301. X              case -2:
  1302. X                  strcpy (new, "    ?");
  1303. X                  break;
  1304. --- 762,769 ----
  1305. X  
  1306. X      blank_len = (COLS - (groupname_len + SELECT_MISC_COLS)) + 2;
  1307. X      
  1308. !     for (j=0, i=first_group_on_screen; i < last_group_on_screen; i++, j++) {
  1309. !         switch (active[my_group[i]].unread) {
  1310. X              case -2:
  1311. X                  strcpy (new, "    ?");
  1312. X                  break;
  1313. ***************
  1314. *** 754,764 ****
  1315. X                  break;
  1316. X  
  1317. X              default:
  1318. !                 sprintf (new, "%5.d", unread[i]);
  1319. X          }
  1320. X          
  1321. X          n = my_group[i];
  1322. !         if (active[n].flag & SUBSCRIBED) {    /* subscribed? */
  1323. X              subs = ' ';
  1324. X          } else {
  1325. X              subs = 'u';    /* u next to unsubscribed groups */
  1326. --- 777,787 ----
  1327. X                  break;
  1328. X  
  1329. X              default:
  1330. !                 sprintf (new, "%5.d", active[my_group[i]].unread);
  1331. X          }
  1332. X          
  1333. X          n = my_group[i];
  1334. !         if (active[n].my_group & SUBSCRIBED) {    /* subscribed? */
  1335. X              subs = ' ';
  1336. X          } else {
  1337. X              subs = 'u';    /* u next to unsubscribed groups */
  1338. ***************
  1339. *** 892,898 ****
  1340. X  }
  1341. X  
  1342. X  /*
  1343. !  *  Add a group to the selection list (my_group[])
  1344. X   *  Return the index of my_group[] if group is added or was already
  1345. X   *  there.  Return -1 if named group is not in active[].
  1346. X   */
  1347. --- 915,921 ----
  1348. X  }
  1349. X  
  1350. X  /*
  1351. !  *  Add a group to the users selection list (my_group[])
  1352. X   *  Return the index of my_group[] if group is added or was already
  1353. X   *  there.  Return -1 if named group is not in active[].
  1354. X   */
  1355. ***************
  1356. *** 914,929 ****
  1357. X                  }
  1358. X              }
  1359. X  
  1360. !             active[i].flag &= ~UNSUBSCRIBED;   /* mark that we got it */
  1361. !             my_group[group_top] = i;
  1362. X  
  1363. !             if (get_unread)
  1364. !                 unread[group_top] = get_line_unread (s, i);
  1365. !             else
  1366. !                 unread[group_top] = -2;
  1367. X  
  1368. X              group_top++;
  1369. !             return group_top - 1;
  1370. X          }
  1371. X      }
  1372. X  
  1373. --- 937,954 ----
  1374. X                  }
  1375. X              }
  1376. X  
  1377. !             active[i].my_group &= ~UNSUBSCRIBED;   /* mark that we got it */
  1378. X  
  1379. !             my_group[group_top] = i;
  1380. X  
  1381. +             if (get_unread) {
  1382. +                 active[my_group[group_top]].unread = get_line_unread (s, i);
  1383. +             } else {
  1384. +                 active[my_group[group_top]].unread = -1;
  1385. +             }
  1386. X              group_top++;
  1387. !             return (group_top - 1);
  1388. X          }
  1389. X      }
  1390. X  
  1391. ***************
  1392. *** 984,991 ****
  1393. X      int goto_next_unread_group;
  1394. X  {    
  1395. X      sprintf (msg, txt_mark_group_read, active[my_group[cur_groupnum]].name);
  1396. !     if (!confirm_action || prompt_yn (LINES, msg, 'y')) {
  1397. !         unread[cur_groupnum] = 0;
  1398. X          mark_group_read (active[my_group[cur_groupnum]].name,
  1399. X              my_group[cur_groupnum]);
  1400. X          
  1401. --- 1009,1016 ----
  1402. X      int goto_next_unread_group;
  1403. X  {    
  1404. X      sprintf (msg, txt_mark_group_read, active[my_group[cur_groupnum]].name);
  1405. !     if (! confirm_action || prompt_yn (LINES, msg, 'y')) {
  1406. !         active[my_group[cur_groupnum]].unread = 0;
  1407. X          mark_group_read (active[my_group[cur_groupnum]].name,
  1408. X              my_group[cur_groupnum]);
  1409. X          
  1410. ***************
  1411. *** 1014,1034 ****
  1412. X  void next_unread_group (enter_group)
  1413. X      int enter_group;
  1414. X  {
  1415. !     int i;
  1416. !     
  1417. !     for (i = cur_groupnum; i < group_top; i++) {
  1418. !         if (unread[i] != 0) {
  1419. X              break;
  1420. X          }
  1421. X      }
  1422. !     if (i >= group_top) {
  1423. X          info_message (txt_no_groups_to_read);
  1424. X          return;
  1425. X      }
  1426. X  
  1427. !     erase_group_arrow ();
  1428. X      cur_groupnum = i;
  1429. !     if (cur_groupnum >= last_group_on_screen) {
  1430. X          group_selection_page ();
  1431. X      } else {
  1432. X          draw_group_arrow ();
  1433. --- 1039,1074 ----
  1434. X  void next_unread_group (enter_group)
  1435. X      int enter_group;
  1436. X  {
  1437. !     int i, all_groups_read = TRUE;
  1438. !     for (i = cur_groupnum ; i < group_top ; i++) {
  1439. !         if (active[my_group[i]].unread != 0) {
  1440. !             all_groups_read = FALSE;
  1441. !             erase_group_arrow ();
  1442. X              break;
  1443. X          }
  1444. X      }
  1445. !     if (all_groups_read) {
  1446. !         for (i = 0 ; i < cur_groupnum ; i++) {
  1447. !             if (active[my_group[i]].unread != 0) {
  1448. !                 all_groups_read = FALSE;
  1449. !                 break;
  1450. !             }
  1451. !         }
  1452. !     }
  1453. !     
  1454. !     if (all_groups_read) {
  1455. X          info_message (txt_no_groups_to_read);
  1456. X          return;
  1457. X      }
  1458. X  
  1459. !     if (i != cur_groupnum) {
  1460. !         erase_group_arrow ();
  1461. !     }
  1462. X      cur_groupnum = i;
  1463. !     if (cur_groupnum < first_group_on_screen ||
  1464. !         cur_groupnum >= last_group_on_screen) {
  1465. X          group_selection_page ();
  1466. X      } else {
  1467. X          draw_group_arrow ();
  1468. ***************
  1469. *** 1081,1093 ****
  1470. X              groupname_len = 0;
  1471. X          }    
  1472. X      }
  1473. X  
  1474. ! /*    
  1475. !     if (groupname_len > (COLS - SELECT_MISC_COLS)) {
  1476. !         groupname_len = COLS - SELECT_MISC_COLS;
  1477. !         if (groupname_len < 0) {
  1478. !             groupname_len = 0;
  1479. !         }    
  1480. X      }
  1481. ! */        
  1482. X  }
  1483. --- 1121,1158 ----
  1484. X              groupname_len = 0;
  1485. X          }    
  1486. X      }
  1487. + }
  1488. X  
  1489. ! void toggle_my_groups (only_unread_groups)
  1490. !     int only_unread_groups;
  1491. ! {
  1492. ! #ifndef INDEX_DAEMON
  1493. !     char buf[8192];
  1494. !     char *ptr;
  1495. !     FILE *fp;
  1496. !     int i;
  1497. !     if ((fp = fopen (newsrc, "r")) != (FILE *) 0) {
  1498. !         group_top = 0;
  1499. !         while (fgets (buf, sizeof (buf), fp) != (char *) 0) {
  1500. !             if (ptr = strchr (buf, ':')) {
  1501. !                 *ptr = '\0';
  1502. !                 if (i = find_group_index (buf)) {
  1503. !                     if (only_unread_groups) {                    
  1504. !                         if (active[i].unread) {
  1505. !                             my_group[group_top] = i;
  1506. !                             group_top++;
  1507. !                         }
  1508. !                     } else {
  1509. !                         my_group[group_top] = i;
  1510. !                         group_top++;
  1511. !                     }    
  1512. !                 }
  1513. !             }
  1514. !         }        
  1515. !         fclose (fp);
  1516. X      }
  1517. ! #endif    /* INDEX_DAEMON */
  1518. X  }
  1519. Files ../1.14/server.patch and ./server.patch are identical
  1520. diff -rcs ../1.14/signal.c ./signal.c
  1521. *** ../1.14/signal.c    Tue Aug 11 21:23:23 1992
  1522. --- ./signal.c    Mon Jul 20 12:51:09 1992
  1523. ***************
  1524. *** 3,9 ****
  1525. X   *  Module    : signal.c
  1526. X   *  Author    : I.Lea
  1527. X   *  Created   : 01-04-91
  1528. !  *  Updated   : 22-06-92
  1529. X   *  Notes     : signal handlers for different modes and window resizing
  1530. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  1531. X   *              You may  freely  copy or  redistribute  this software,
  1532. --- 3,9 ----
  1533. X   *  Module    : signal.c
  1534. X   *  Author    : I.Lea
  1535. X   *  Created   : 01-04-91
  1536. !  *  Updated   : 20-07-92
  1537. X   *  Notes     : signal handlers for different modes and window resizing
  1538. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  1539. X   *              You may  freely  copy or  redistribute  this software,
  1540. ***************
  1541. *** 105,117 ****
  1542. X  
  1543. X  void set_alarm_signal ()
  1544. X  {
  1545. ! #ifndef NO_RESYNC_ACTIVE_FILE
  1546. X      /*
  1547. X       * Only reread active file if news is not static (ie. CD-ROM)
  1548. X       */
  1549. X      if (strcmp (spooldir_alias, "news") == 0) {
  1550. X          signal (SIGALRM, signal_handler);
  1551. !         alarm (RESYNC_ACTIVE_SECS);
  1552. X      }    
  1553. X      reread_active_file = FALSE;
  1554. X  #endif
  1555. --- 105,118 ----
  1556. X  
  1557. X  void set_alarm_signal ()
  1558. X  {
  1559. ! #ifndef NO_REREAD_ACTIVE_FILE
  1560. X      /*
  1561. X       * Only reread active file if news is not static (ie. CD-ROM)
  1562. X       */
  1563. +     (void) alarm (0);
  1564. X      if (strcmp (spooldir_alias, "news") == 0) {
  1565. X          signal (SIGALRM, signal_handler);
  1566. !         alarm (reread_active_file_secs);
  1567. X      }    
  1568. X      reread_active_file = FALSE;
  1569. X  #endif
  1570. ***************
  1571. *** 120,126 ****
  1572. X  
  1573. X  void set_alarm_clock_on ()
  1574. X  {
  1575. ! #ifndef NO_RESYNC_ACTIVE_FILE
  1576. X      alarm (time_remaining);
  1577. X  #endif
  1578. X  }
  1579. --- 121,127 ----
  1580. X  
  1581. X  void set_alarm_clock_on ()
  1582. X  {
  1583. ! #ifndef NO_REREAD_ACTIVE_FILE
  1584. X      alarm (time_remaining);
  1585. X  #endif
  1586. X  }
  1587. ***************
  1588. *** 128,134 ****
  1589. X  
  1590. X  void set_alarm_clock_off ()
  1591. X  {
  1592. ! #ifndef NO_RESYNC_ACTIVE_FILE
  1593. X      time_remaining = alarm (0);
  1594. X  #endif
  1595. X  }
  1596. --- 129,135 ----
  1597. X  
  1598. X  void set_alarm_clock_off ()
  1599. X  {
  1600. ! #ifndef NO_REREAD_ACTIVE_FILE
  1601. X      time_remaining = alarm (0);
  1602. X  #endif
  1603. X  }
  1604. ***************
  1605. *** 176,182 ****
  1606. X          case SIGSEGV:
  1607. X              sigtext = "SIGSEGV ";
  1608. X              break;
  1609. ! #ifndef NO_RESYNC_ACTIVE_FILE
  1610. X          case SIGALRM:
  1611. X              set_alarm_signal ();
  1612. X              reread_active_file = TRUE;
  1613. --- 177,183 ----
  1614. X          case SIGSEGV:
  1615. X              sigtext = "SIGSEGV ";
  1616. X              break;
  1617. ! #ifndef NO_REREAD_ACTIVE_FILE
  1618. X          case SIGALRM:
  1619. X              set_alarm_signal ();
  1620. X              reread_active_file = TRUE;
  1621. ***************
  1622. *** 200,208 ****
  1623. X          unlink (index_file);
  1624. X      }
  1625. X  
  1626. ! #ifdef INDEX_DAEMON
  1627. !     unlink (LOCK_FILE);
  1628. ! #endif
  1629. X      exit (1);
  1630. X  }
  1631. X  
  1632. --- 201,208 ----
  1633. X          unlink (index_file);
  1634. X      }
  1635. X  
  1636. !     unlink (lock_file);
  1637. X      exit (1);
  1638. X  }
  1639. X  
  1640. ***************
  1641. *** 296,301 ****
  1642. --- 296,315 ----
  1643. X  }
  1644. X  
  1645. X  
  1646. + void set_signals_help ()
  1647. + {
  1648. + #ifdef SIGTSTP
  1649. +     if (do_sigtstp) {
  1650. +         sigdisp (SIGTSTP, help_suspend);
  1651. +     }
  1652. + #endif
  1653. + #ifdef SIGWINCH
  1654. +     signal (SIGWINCH, help_resize);
  1655. + #endif
  1656. + }
  1657. X  void set_signals_page ()
  1658. X  {
  1659. X  #ifdef SIGTSTP
  1660. ***************
  1661. *** 455,460 ****
  1662. --- 469,494 ----
  1663. X  
  1664. X  
  1665. X  /* ARGSUSED0 */
  1666. + void help_suspend (sig)
  1667. +     int sig;
  1668. + {
  1669. +     set_keypad_off ();
  1670. +     Raw (FALSE);
  1671. +     wait_message (txt_suspended_message);
  1672. +     kill (0, SIGSTOP);
  1673. +     sigdisp (SIGTSTP, help_suspend);
  1674. +     if (! update) {
  1675. +         Raw (TRUE);
  1676. +         help_resize (0);        
  1677. +     }
  1678. +     set_keypad_on ();
  1679. + }
  1680. + /* ARGSUSED0 */
  1681. X  void page_suspend (sig)
  1682. X      int sig;
  1683. X  {
  1684. ***************
  1685. *** 558,564 ****
  1686. X      ClearScreen ();
  1687. X  #endif
  1688. X      mail_setup ();
  1689. !     if (resized) {
  1690. X          group_selection_page ();
  1691. X      }    
  1692. X  }
  1693. --- 592,598 ----
  1694. X      ClearScreen ();
  1695. X  #endif
  1696. X      mail_setup ();
  1697. !     if (resized || sig == 0) {
  1698. X          group_selection_page ();
  1699. X      }    
  1700. X  }
  1701. ***************
  1702. *** 579,585 ****
  1703. X      ClearScreen ();
  1704. X  #endif
  1705. X      mail_setup ();
  1706. !     if (resized) {
  1707. X          show_spooldir_page ();
  1708. X      }
  1709. X  }
  1710. --- 613,619 ----
  1711. X      ClearScreen ();
  1712. X  #endif
  1713. X      mail_setup ();
  1714. !     if (resized || sig == 0) {
  1715. X          show_spooldir_page ();
  1716. X      }
  1717. X  }
  1718. ***************
  1719. *** 600,606 ****
  1720. X      ClearScreen ();
  1721. X  #endif
  1722. X      mail_setup ();
  1723. !     if (resized) {
  1724. X          show_group_page (glob_group);
  1725. X      }    
  1726. X  }
  1727. --- 634,640 ----
  1728. X      ClearScreen ();
  1729. X  #endif
  1730. X      mail_setup ();
  1731. !     if (resized || sig == 0) {
  1732. X          show_group_page (glob_group);
  1733. X      }    
  1734. X  }
  1735. ***************
  1736. *** 607,612 ****
  1737. --- 641,662 ----
  1738. X  
  1739. X  
  1740. X  /* ARGSUSED0 */
  1741. + void help_resize (sig)
  1742. +     int sig;
  1743. + {
  1744. +     int resized = TRUE;
  1745. +     
  1746. + #ifdef SIGWINCH
  1747. +     resized = set_win_size (&LINES, &COLS);
  1748. +     signal (SIGWINCH, help_resize);
  1749. + #endif
  1750. +     
  1751. +     if (resized || sig == 0) {
  1752. +         display_info_page ();
  1753. +     }
  1754. + }
  1755. + /* ARGSUSED0 */
  1756. X  void page_resize (sig)
  1757. X      int sig;
  1758. X  {
  1759. ***************
  1760. *** 621,627 ****
  1761. X      ClearScreen ();
  1762. X  #endif
  1763. X      mail_setup ();
  1764. !     if (resized) {
  1765. X          redraw_page (glob_respnum, glob_page_group);
  1766. X      }    
  1767. X  }
  1768. --- 671,677 ----
  1769. X      ClearScreen ();
  1770. X  #endif
  1771. X      mail_setup ();
  1772. !     if (resized || sig == 0) {
  1773. X          redraw_page (glob_respnum, glob_page_group);
  1774. X      }    
  1775. X  }
  1776. ***************
  1777. *** 642,648 ****
  1778. X      ClearScreen ();
  1779. X  #endif
  1780. X      mail_setup ();
  1781. !     if (resized) {
  1782. X          show_thread_page ();
  1783. X      }    
  1784. X  }
  1785. --- 692,698 ----
  1786. X      ClearScreen ();
  1787. X  #endif
  1788. X      mail_setup ();
  1789. !     if (resized || sig == 0) {
  1790. X          show_thread_page ();
  1791. X      }    
  1792. X  }
  1793. diff -rcs ../1.14/spooldir.c ./spooldir.c
  1794. *** ../1.14/spooldir.c    Tue Aug 11 21:23:24 1992
  1795. --- ./spooldir.c    Mon Jul 20 12:51:09 1992
  1796. ***************
  1797. *** 3,9 ****
  1798. X   *  Module    : spooldir.c
  1799. X   *  Author    : I.Lea & Tom Theel
  1800. X   *  Created   : 08-05-92
  1801. !  *  Updated   : 20-06-92
  1802. X   *  Notes     : Changes spooldir to read news from (ie. news, nntp, cdrom)
  1803. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Tom Theel
  1804. X   *              You may  freely  copy or  redistribute  this software,
  1805. --- 3,9 ----
  1806. X   *  Module    : spooldir.c
  1807. X   *  Author    : I.Lea & Tom Theel
  1808. X   *  Created   : 08-05-92
  1809. !  *  Updated   : 30-06-92
  1810. X   *  Notes     : Changes spooldir to read news from (ie. news, nntp, cdrom)
  1811. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Tom Theel
  1812. X   *              You may  freely  copy or  redistribute  this software,
  1813. ***************
  1814. *** 14,34 ****
  1815. X  
  1816. X  #include    "tin.h"
  1817. X  
  1818. - #define NUM_SPOOLDIRS    50
  1819. X  int cur_spoolnum = 0;
  1820. X  int first_spooldir_on_screen;
  1821. X  int last_spooldir_on_screen;
  1822. - int num_spooldirs = 0;
  1823. X  int spool_top = 0;
  1824. X  
  1825. X  /*
  1826. -  * needs to be dynamic but no time 
  1827. -  */
  1828. - struct spooldir_t spooldirs[NUM_SPOOLDIRS];
  1829. - /*
  1830. X   * Change spooldir via menu of available choices
  1831. X   */
  1832. X  
  1833. --- 14,25 ----
  1834. ***************
  1835. *** 40,54 ****
  1836. X      int n;
  1837. X      int scroll_lines;
  1838. X      
  1839. !     spool_top = num_spooldirs;
  1840. X  
  1841. X      if (! xspooldir_supported) {
  1842. !         info_message ("Multiple spooldirs are not supported");
  1843. X          return FALSE;
  1844. X      }
  1845. X  
  1846. X      if (! spool_top) {
  1847. !         info_message ("No spooldirs");
  1848. X          return FALSE;
  1849. X      }
  1850. X  
  1851. --- 31,45 ----
  1852. X      int n;
  1853. X      int scroll_lines;
  1854. X      
  1855. !     spool_top = num_spooldir;
  1856. X  
  1857. X      if (! xspooldir_supported) {
  1858. !         info_message (txt_spooldirs_not_supported);
  1859. X          return FALSE;
  1860. X      }
  1861. X  
  1862. X      if (! spool_top) {
  1863. !         info_message (txt_no_spooldirs);
  1864. X          return FALSE;
  1865. X      }
  1866. X  
  1867. ***************
  1868. *** 300,306 ****
  1869. X  
  1870. X              case 'q':    /* quit */
  1871. X                  return TRUE;
  1872. -                 break;
  1873. X                  
  1874. X              case 'Q':    /* quit */
  1875. X                  write_rcfile ();
  1876. --- 291,296 ----
  1877. ***************
  1878. *** 337,343 ****
  1879. X      CleartoEOLN ();
  1880. X  #endif
  1881. X  
  1882. !     sprintf (buf, txt_spooldir_selection, num_spooldirs);
  1883. X      show_title (buf);
  1884. X  
  1885. X  #ifndef USE_CLEARSCREEN
  1886. --- 327,333 ----
  1887. X      CleartoEOLN ();
  1888. X  #endif
  1889. X  
  1890. !     sprintf (buf, txt_spooldir_selection, num_spooldir);
  1891. X      show_title (buf);
  1892. X  
  1893. X  #ifndef USE_CLEARSCREEN
  1894. ***************
  1895. *** 462,476 ****
  1896. X      char *ptr;
  1897. X      int i, state;
  1898. X  
  1899. ! #if 0
  1900. !     spooldirs = (struct spooldir_t *) 0;
  1901. ! #else
  1902. !     for (i = 0 ; i < NUM_SPOOLDIRS ; i++) {
  1903. X          spooldirs[i].state = 0;
  1904. X          spooldirs[i].name = (char *) 0;
  1905. X      }
  1906. - #endif
  1907. X  
  1908. X      xspooldir_supported = FALSE;
  1909. X      
  1910. X      if (! read_news_via_nntp) {
  1911. --- 452,464 ----
  1912. X      char *ptr;
  1913. X      int i, state;
  1914. X  
  1915. !     for (i = 0 ; i < max_spooldir ; i++) {
  1916. X          spooldirs[i].state = 0;
  1917. X          spooldirs[i].name = (char *) 0;
  1918. +         spooldirs[i].comment = (char *) 0;
  1919. X      }
  1920. X  
  1921. +     num_spooldir = 0;
  1922. X      xspooldir_supported = FALSE;
  1923. X      
  1924. X      if (! read_news_via_nntp) {
  1925. ***************
  1926. *** 483,490 ****
  1927. X          xspooldir_supported = FALSE;
  1928. X          if (debug > 0) {
  1929. X              fprintf (stderr, "%s", line);
  1930. !             fprintf (stderr, "Server does not appear to support the spooldir command\n");
  1931. !             fprintf (stderr, "Reconfigure the news reader or the server & try again.\n");
  1932. X          }
  1933. X          return (xspooldir_supported);
  1934. X      }
  1935. --- 471,478 ----
  1936. X          xspooldir_supported = FALSE;
  1937. X          if (debug > 0) {
  1938. X              fprintf (stderr, "%s", line);
  1939. !             fprintf (stderr, txt_spooldir_server_error_1);
  1940. !             fprintf (stderr, txt_spooldir_server_error_2);
  1941. X          }
  1942. X          return (xspooldir_supported);
  1943. X      }
  1944. ***************
  1945. *** 514,540 ****
  1946. X                  *ptr = '\0';                
  1947. X              }
  1948. X  
  1949. ! /*                
  1950. !             spooldirs = (struct spooldir_t *) my_realloc ((char *) spooldirs,
  1951. !                 (unsigned) sizeof (struct spooldir_t) * num_spooldirs + 1);
  1952. !             if (spooldirs != (struct spooldir_t *) 0) {
  1953. !                 spooldirs[num_spooldirs].state = state;
  1954. !                 spooldirs[num_spooldirs].name = str_dup (name);
  1955. !                 spooldirs[num_spooldirs].comment = str_dup (comment);
  1956. !                 num_spooldirs++;
  1957. !             }    
  1958. ! */                
  1959. X  
  1960. !             spooldirs[num_spooldirs].state = state;
  1961. !             spooldirs[num_spooldirs].name = str_dup (name);
  1962. !             spooldirs[num_spooldirs].comment = str_dup (comment);
  1963. X  
  1964. X              if (debug == 1) {
  1965. !                 printf ("ALIAS=[%s] COMMENT=[%s]\n", 
  1966. !                     spooldirs[num_spooldirs].name,
  1967. !                     spooldirs[num_spooldirs].comment);
  1968. X              }
  1969. !             num_spooldirs++;
  1970. X          }
  1971. X      } while (!((line[0] == '.') && ((line[1] == '\0') || (line[1] == '\r'))));
  1972. X  
  1973. --- 502,522 ----
  1974. X                  *ptr = '\0';                
  1975. X              }
  1976. X  
  1977. !             if (num_spooldir > max_spooldir) {
  1978. !                 expand_spooldirs ();
  1979. !             }
  1980. X  
  1981. !             spooldirs[num_spooldir].state = state;
  1982. !             spooldirs[num_spooldir].name = str_dup (name);
  1983. !             spooldirs[num_spooldir].comment = str_dup (comment);
  1984. X  
  1985. X              if (debug == 1) {
  1986. !                 printf ("STATE=[%d] ALIAS=[%s] COMMENT=[%s]\n", 
  1987. !                     spooldirs[num_spooldir].state,
  1988. !                     spooldirs[num_spooldir].name,
  1989. !                     spooldirs[num_spooldir].comment);
  1990. X              }
  1991. !             num_spooldir++;
  1992. X          }
  1993. X      } while (!((line[0] == '.') && ((line[1] == '\0') || (line[1] == '\r'))));
  1994. X  
  1995. ***************
  1996. *** 549,556 ****
  1997. --- 531,540 ----
  1998. X  void get_spooldir ()
  1999. X  {
  2000. X  #ifdef NNTP_ABLE
  2001. + #if 0
  2002. X      char line[NNTP_STRLEN];
  2003. X      char alias[32];
  2004. + #endif    
  2005. X      char default_alias[32];
  2006. X      int i, set_alias = FALSE;
  2007. X      
  2008. ***************
  2009. *** 585,591 ****
  2010. X              }
  2011. X          }
  2012. X          if (! set_alias) {
  2013. !             error_message ("%s: Cannot change to valid spooldir. Exiting...", progname);
  2014. X              exit (1);            
  2015. X          }
  2016. X      }
  2017. --- 569,575 ----
  2018. X              }
  2019. X          }
  2020. X          if (! set_alias) {
  2021. !             error_message (txt_cannot_change_spooldir, progname);
  2022. X              exit (1);            
  2023. X          }
  2024. X      }
  2025. ***************
  2026. *** 625,633 ****
  2027. X      int respcode;
  2028. X  
  2029. X      if (cmd_line) {
  2030. !         sprintf (line, "Changing spooldir to %s...\n", name);
  2031. X      } else {
  2032. !         sprintf (line, "Changing spooldir to %s...", name);
  2033. X      }    
  2034. X      wait_message (line);
  2035. X  
  2036. --- 609,617 ----
  2037. X      int respcode;
  2038. X  
  2039. X      if (cmd_line) {
  2040. !         sprintf (line, "%s %s...\n", txt_changing_sppoldir_to, name);
  2041. X      } else {
  2042. !         sprintf (line, "%s %s...", txt_changing_sppoldir_to, name);
  2043. X      }    
  2044. X      wait_message (line);
  2045. X  
  2046. ***************
  2047. *** 642,654 ****
  2048. X              my_strncpy (spooldir_alias, name, sizeof (spooldir_alias));
  2049. X              set_tindir ();
  2050. X              return TRUE;
  2051. -             break;
  2052. X          case OK_SPNOCHANGE:    /* Still using same spooldir */
  2053. X              break;
  2054. X          default:
  2055. X              error_message ("%s", nntp_respcode (respcode));
  2056. X              clear_message ();
  2057. !             return FALSE;
  2058. !             break;        
  2059. X      }
  2060. X  }
  2061. --- 626,637 ----
  2062. X              my_strncpy (spooldir_alias, name, sizeof (spooldir_alias));
  2063. X              set_tindir ();
  2064. X              return TRUE;
  2065. X          case OK_SPNOCHANGE:    /* Still using same spooldir */
  2066. X              break;
  2067. X          default:
  2068. X              error_message ("%s", nntp_respcode (respcode));
  2069. X              clear_message ();
  2070. !             break;
  2071. X      }
  2072. +     return FALSE;
  2073. X  }
  2074. diff -rcs ../1.14/thread.c ./thread.c
  2075. *** ../1.14/thread.c    Tue Aug 11 21:23:25 1992
  2076. --- ./thread.c    Fri Aug  7 19:10:52 1992
  2077. ***************
  2078. *** 3,9 ****
  2079. X   *  Module    : thread.c
  2080. X   *  Author    : I.Lea
  2081. X   *  Created   : 01-04-91
  2082. !  *  Updated   : 20-06-92
  2083. X   *  Notes     :
  2084. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  2085. X   *              You may  freely  copy or  redistribute  this software,
  2086. --- 3,9 ----
  2087. X   *  Module    : thread.c
  2088. X   *  Author    : I.Lea
  2089. X   *  Created   : 01-04-91
  2090. !  *  Updated   : 24-07-92
  2091. X   *  Notes     :
  2092. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  2093. X   *              You may  freely  copy or  redistribute  this software,
  2094. ***************
  2095. *** 35,50 ****
  2096. X      int i;
  2097. X  {
  2098. X  #ifndef INDEX_DAEMON
  2099. !     int j;
  2100. X      char mark;
  2101. X      char new_resps[8];
  2102. X      char from[LEN];
  2103. X      int len_from;
  2104. X      int len_subj = 0;
  2105. X      int off_subj = 0;
  2106. X      int off_both = 0;
  2107. -     char *spaces = "XXX";
  2108. X  
  2109. X      if (! draw_arrow_mark) {
  2110. X          off_subj = 2;
  2111. --- 35,50 ----
  2112. X      int i;
  2113. X  {
  2114. X  #ifndef INDEX_DAEMON
  2115. !     extern int cur_groupnum;
  2116. X      char mark;
  2117. X      char new_resps[8];
  2118. X      char from[LEN];
  2119. !     char *spaces = "XXX";
  2120. !     int j;
  2121. X      int len_from;
  2122. X      int len_subj = 0;
  2123. X      int off_subj = 0;
  2124. X      int off_both = 0;
  2125. X  
  2126. X      if (! draw_arrow_mark) {
  2127. X          off_subj = 2;
  2128. ***************
  2129. *** 72,80 ****
  2130. X          sprintf (new_resps, "%3d", arts[i].tagged);
  2131. X      } else {
  2132. X          if (arts[i].unread == ART_UNREAD) {
  2133. !             mark = (arts[i].hot ? HOT_ART_MARK : UNREAD_ART_MARK);
  2134. X          } else if (arts[i].unread == ART_WILL_RETURN) {
  2135. !             mark =  RETURN_ART_MARK;
  2136. X          } else {
  2137. X              mark = READ_ART_MARK;
  2138. X          }
  2139. --- 72,80 ----
  2140. X          sprintf (new_resps, "%3d", arts[i].tagged);
  2141. X      } else {
  2142. X          if (arts[i].unread == ART_UNREAD) {
  2143. !             mark = (arts[i].hot ? hot_art_mark : unread_art_mark);
  2144. X          } else if (arts[i].unread == ART_WILL_RETURN) {
  2145. !             mark =  return_art_mark;
  2146. X          } else {
  2147. X              mark = READ_ART_MARK;
  2148. X          }
  2149. ***************
  2150. *** 82,89 ****
  2151. X      }
  2152. X      
  2153. X      from[0] = '\0';
  2154. !     if (threaded_on_subject || show_author != SHOW_FROM_NONE)
  2155. X          get_author (TRUE, i, from);
  2156. X  
  2157. X      sprintf (screen[j].col, "  %4d%3s  %-*.*s%s%-*.*s",
  2158. X           l, new_resps, len_subj, len_subj, arts[i].subject, 
  2159. --- 82,90 ----
  2160. X      }
  2161. X      
  2162. X      from[0] = '\0';
  2163. !     if (threaded_on_subject || show_author != SHOW_FROM_NONE) {
  2164. X          get_author (TRUE, i, from);
  2165. +     }    
  2166. X  
  2167. X      sprintf (screen[j].col, "  %4d%3s  %-*.*s%s%-*.*s",
  2168. X           l, new_resps, len_subj, len_subj, arts[i].subject, 
  2169. ***************
  2170. *** 121,127 ****
  2171. X      /* it is somewhat less efficient to go back and redo that art mark
  2172. X       * if hot, but it is quite readable as to what is happening 
  2173. X       */
  2174. !     if (screen[j].col[k] == HOT_ART_MARK) {
  2175. X          MoveCursor (INDEX2LNUM(i), k);
  2176. X          ToggleInverse ();
  2177. X          fputc (screen[j].col[k], stdout);
  2178. --- 122,128 ----
  2179. X      /* it is somewhat less efficient to go back and redo that art mark
  2180. X       * if hot, but it is quite readable as to what is happening 
  2181. X       */
  2182. !     if (screen[j].col[k] == hot_art_mark) {
  2183. X          MoveCursor (INDEX2LNUM(i), k);
  2184. X          ToggleInverse ();
  2185. X          fputc (screen[j].col[k], stdout);
  2186. ***************
  2187. *** 168,174 ****
  2188. X  
  2189. X      thread_index_point = top_thread;
  2190. X      if (space_mode) {
  2191. !         if (i = new_responses (thread_basenote)) {
  2192. X              for (n=0, i = base[thread_basenote]; i >= 0 ;
  2193. X                   i = arts[i].thread, n++) {
  2194. X                  if (arts[i].unread == ART_UNREAD) {
  2195. --- 169,176 ----
  2196. X  
  2197. X      thread_index_point = top_thread;
  2198. X      if (space_mode) {
  2199. !         i = new_responses (thread_basenote);
  2200. !         if (i) {
  2201. X              for (n=0, i = base[thread_basenote]; i >= 0 ;
  2202. X                   i = arts[i].thread, n++) {
  2203. X                  if (arts[i].unread == ART_UNREAD) {
  2204. ***************
  2205. *** 446,452 ****
  2206. X                      arts[i].unread = ART_READ;
  2207. X                  }
  2208. X                  goto thread_done;
  2209. -                 break;
  2210. X  
  2211. X              case 'd':    /* toggle display of subject & subj/author */
  2212. X                  if (! threaded_on_subject) {
  2213. --- 448,453 ----
  2214. ***************
  2215. *** 500,508 ****
  2216. --- 501,519 ----
  2217. X              case 'Z':    /* mark thread as unread */
  2218. X                  n = choose_response (thread_basenote, thread_index_point);
  2219. X                  if (ch == 'z') {
  2220. +                     if (arts[n].unread == ART_READ) {
  2221. +                         if (arts[n].hot) {
  2222. +                             num_of_hot_arts++;
  2223. +                         }
  2224. +                     }
  2225. X                      arts[n].unread = ART_UNREAD;
  2226. X                  } else {
  2227. X                      for (i = (int) base[thread_basenote] ; i != -1; i = arts[i].thread) {
  2228. +                         if (arts[n].unread == ART_READ) {
  2229. +                             if (arts[n].hot) {
  2230. +                                 num_of_hot_arts++;
  2231. +                             }
  2232. +                         }
  2233. X                          arts[i].unread = ART_UNREAD;
  2234. X                      }
  2235. X                  }
  2236. ***************
  2237. *** 571,583 ****
  2238. X  #ifndef INDEX_DAEMON
  2239. X  
  2240. X      extern int index_point;
  2241. -     char new_resps[8];
  2242. -     char from[LEN];
  2243. X      int i, j;
  2244. -     int len_from;
  2245. -     int len_subj = 0;
  2246. -     int off_subj = 0;
  2247. -     int off_both = 0;
  2248. X      static int index = 0;
  2249. X  
  2250. X      set_signals_thread ();
  2251. --- 582,588 ----
  2252. ***************
  2253. *** 629,651 ****
  2254. X      index = choose_response (thread_basenote, first_thread_on_screen);
  2255. X      assert(first_thread_on_screen != 0 || index == thread_respnum);
  2256. X  
  2257. -     if (! draw_arrow_mark) {
  2258. -         off_subj = 2;
  2259. -         off_both = 5;
  2260. -     }    
  2261. -     if (threaded_on_subject) {
  2262. -         len_from = max_subj+max_from+off_both;
  2263. -     } else {
  2264. -         if (show_author != SHOW_FROM_NONE) {
  2265. -             len_from = max_from;
  2266. -             len_subj = max_subj+off_subj;
  2267. -         } else {
  2268. -             len_from = 0;
  2269. -             len_subj = max_from+max_subj+off_subj;
  2270. -         }
  2271. -     }    
  2272. X      for (j=0, i = first_thread_on_screen; j < NOTESLINES && i < last_thread_on_screen; i++, j++) {
  2273. X          bld_tline (i, index);
  2274. X          draw_tline (i, TRUE);
  2275. --- 634,639 ----
  2276. ***************
  2277. *** 759,765 ****
  2278. X      int sum = 0;
  2279. X  
  2280. X      for (i = (int) base[thread]; i >= 0; i = arts[i].thread) {
  2281. !         if (arts[i].unread) {
  2282. X              sum++;
  2283. X          }
  2284. X      }
  2285. --- 747,753 ----
  2286. X      int sum = 0;
  2287. X  
  2288. X      for (i = (int) base[thread]; i >= 0; i = arts[i].thread) {
  2289. !         if (arts[i].unread != ART_READ) {
  2290. X              sum++;
  2291. X          }
  2292. X      }
  2293. ***************
  2294. *** 885,895 ****
  2295. X  
  2296. X  
  2297. X      if (sbuf->hot_unread)
  2298. !         sbuf->art_mark = HOT_ART_MARK;
  2299. X      else if (sbuf->unread)
  2300. !         sbuf->art_mark = UNREAD_ART_MARK;
  2301. X      else if (sbuf->seen)
  2302. !         sbuf->art_mark = RETURN_ART_MARK;
  2303. X      else
  2304. X          sbuf->art_mark = READ_ART_MARK;
  2305. X  
  2306. --- 873,883 ----
  2307. X  
  2308. X  
  2309. X      if (sbuf->hot_unread)
  2310. !         sbuf->art_mark = hot_art_mark;
  2311. X      else if (sbuf->unread)
  2312. !         sbuf->art_mark = unread_art_mark;
  2313. X      else if (sbuf->seen)
  2314. !         sbuf->art_mark = return_art_mark;
  2315. X      else
  2316. X          sbuf->art_mark = READ_ART_MARK;
  2317. X  
  2318. ***************
  2319. *** 907,920 ****
  2320. X  {
  2321. X      int i;
  2322. X  
  2323. !     if (arts[n].thread >= 0)
  2324. X          return arts[n].thread;
  2325. X      i = which_thread (n) + 1;
  2326. X  
  2327. !     if (i >= top_base)
  2328. X          return -1;
  2329. X      return (int) base[i];
  2330. X  }
  2331. X  
  2332. --- 895,910 ----
  2333. X  {
  2334. X      int i;
  2335. X  
  2336. !     if (arts[n].thread >= 0) {
  2337. X          return arts[n].thread;
  2338. !     }
  2339. !     
  2340. X      i = which_thread (n) + 1;
  2341. X  
  2342. !     if (i >= top_base) {
  2343. X          return -1;
  2344. !     }
  2345. !     
  2346. X      return (int) base[i];
  2347. X  }
  2348. X  
  2349. ***************
  2350. *** 979,990 ****
  2351. X  }
  2352. X  
  2353. X  /*
  2354. !  *  Find the next unread response in this group 
  2355. X   */
  2356. X  
  2357. X  int next_unread (n)
  2358. X      int n;
  2359. X  {
  2360. X      while (n >= 0) {
  2361. X          if (arts[n].unread == ART_UNREAD) {
  2362. X              return n;
  2363. --- 969,983 ----
  2364. X  }
  2365. X  
  2366. X  /*
  2367. !  *  Find the next unread response in this group. If no response is found
  2368. !  *  from current point to the end restart from beginning of articles.
  2369. X   */
  2370. X  
  2371. X  int next_unread (n)
  2372. X      int n;
  2373. X  {
  2374. +     int cur_base_art = n;
  2375. +     
  2376. X      while (n >= 0) {
  2377. X          if (arts[n].unread == ART_UNREAD) {
  2378. X              return n;
  2379. ***************
  2380. *** 992,1000 ****
  2381. X          n = next_response (n);
  2382. X      }
  2383. X  
  2384. X      return -1;
  2385. X  }
  2386. X  
  2387. X  /*
  2388. X   *  Find the previous unread response in this thread
  2389. --- 985,1000 ----
  2390. X          n = next_response (n);
  2391. X      }
  2392. X  
  2393. +     n = base[0];
  2394. +     while (n != cur_base_art) {
  2395. +         if (arts[n].unread == ART_UNREAD) {
  2396. +             return n;
  2397. +         }
  2398. +         n = next_response (n);
  2399. +     }
  2400. +     
  2401. X      return -1;
  2402. X  }
  2403. X  
  2404. X  /*
  2405. X   *  Find the previous unread response in this thread
  2406. Only in .: tin-1.15.diff
  2407. diff -rcs ../1.14/tin.1 ./tin.1
  2408. *** ../1.14/tin.1    Tue Aug 11 21:22:58 1992
  2409. --- ./tin.1    Tue Aug 11 20:52:10 1992
  2410. ***************
  2411. *** 6,12 ****
  2412. X  .if t .ll 6.85i
  2413. X  .if n .ll 7.2i
  2414. X  .if \n(mo=1 .ds mo January
  2415. ! .if \n(mo=2 .ds mo Febraury
  2416. X  .if \n(mo=3 .ds mo March
  2417. X  .if \n(mo=4 .ds mo April
  2418. X  .if \n(mo=5 .ds mo May
  2419. --- 6,12 ----
  2420. X  .if t .ll 6.85i
  2421. X  .if n .ll 7.2i
  2422. X  .if \n(mo=1 .ds mo January
  2423. ! .if \n(mo=2 .ds mo February
  2424. X  .if \n(mo=3 .ds mo March
  2425. X  .if \n(mo=4 .ds mo April
  2426. X  .if \n(mo=5 .ds mo May
  2427. ***************
  2428. *** 17,23 ****
  2429. X  .if \n(mo=10 .ds mo October
  2430. X  .if \n(mo=11 .ds mo November
  2431. X  .if \n(mo=12 .ds mo December
  2432. ! .TH TIN 1 "Version 1.1 PL4" "" "LOCAL"
  2433. SHAR_EOF
  2434. true || echo 'restore of tin-1.15.patch failed'
  2435. fi
  2436. echo 'End of tin-1.15 part 6'
  2437. echo 'File tin-1.15.patch is continued in part 7'
  2438. echo 7 > _shar_seq_.tmp
  2439. exit 0
  2440.  
  2441. --
  2442. NAME   Iain Lea 
  2443. EMAIL  iain%anl433.uucp@Germany.EU.net
  2444. SNAIL  Siemens AG, ANL A433SZ, Gruendlacher Str. 248, 8510 Fuerth, Germany.
  2445. PHONE  +49-911-3089-407 (work) +49-911-331963 (home) +49-911-3089-290 (FAX)  
  2446. exit 0 # Just in case...
  2447.