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

  1. Newsgroups: comp.sources.misc
  2. From: iain%anl433.uucp@Germany.EU.net (Iain Lea)
  3. Subject:  v31i083:  tin - threaded full screen newsreader v1.1, Patch05d/7
  4. Message-ID: <1992Aug16.012642.12729@sparky.imd.sterling.com>
  5. X-Md4-Signature: 5f7ad31016cb87e319de7a045e2c22ed
  6. Date: Sun, 16 Aug 1992 01:26:42 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 83
  11. Archive-name: tin/patch05d
  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.04 (part 4 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" != 4; 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. --- 3,9 ----
  38. X   *  Module    : kill.c
  39. X   *  Author    : I.Lea & J.Robinson
  40. X   *  Created   : 01-04-91
  41. !  *  Updated   : 05-08-92
  42. X   *  Notes     : kill & auto select (hot) articles
  43. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Jim Robinson
  44. X   *              You may  freely  copy or  redistribute  this software,
  45. ***************
  46. *** 20,26 ****
  47. X  char *stars = "*";
  48. X  #endif
  49. X  
  50. ! #define SET_KILLED(i)        (arts[i].unread = ART_READ, arts[i].killed = 1, num_of_killed_arts++)
  51. X  #define SET_HOT(i)        (arts[i].hot = 1)
  52. X  #define IS_READ(i)        (arts[i].unread == ART_READ)
  53. X  #define IS_KILLED(i)        (arts[i].killed == 1)
  54. --- 20,26 ----
  55. X  char *stars = "*";
  56. X  #endif
  57. X  
  58. ! #define SET_KILLED(i)        (arts[i].unread = ART_READ, arts[i].killed = 1)
  59. X  #define SET_HOT(i)        (arts[i].hot = 1)
  60. X  #define IS_READ(i)        (arts[i].unread == ART_READ)
  61. X  #define IS_KILLED(i)        (arts[i].killed == 1)
  62. ***************
  63. *** 33,39 ****
  64. X  
  65. X  int kill_level = 1;
  66. X  int kill_num = 0;
  67. - int max_kill;
  68. X  struct kill_t *killf;
  69. X  
  70. X  /*
  71. --- 33,38 ----
  72. ***************
  73. *** 231,237 ****
  74. X  #ifdef SIGTSTP
  75. X      sigtype_t (*susp)();
  76. X      
  77. !     susp = (sigtype_t *) 0;
  78. X  
  79. X      if (do_sigtstp) {
  80. X          susp = sigdisp (SIGTSTP, SIG_DFL);
  81. --- 230,236 ----
  82. X  #ifdef SIGTSTP
  83. X      sigtype_t (*susp)();
  84. X      
  85. !     susp = (sigtype_t (*)()) 0;
  86. X  
  87. X      if (do_sigtstp) {
  88. X          susp = sigdisp (SIGTSTP, SIG_DFL);
  89. ***************
  90. *** 330,336 ****
  91. X              killed = TRUE;
  92. X              goto kill_done;
  93. X  
  94. !         case 'a':
  95. X          case ESC:
  96. X              killed = FALSE;
  97. X              goto kill_done;
  98. --- 329,335 ----
  99. X              killed = TRUE;
  100. X              goto kill_done;
  101. X  
  102. !         case 'q':
  103. X          case ESC:
  104. X              killed = FALSE;
  105. X              goto kill_done;
  106. ***************
  107. *** 429,437 ****
  108. X      return (unkilled);
  109. X  }
  110. X  
  111. ! int kill_any_articles (group)
  112. !     char *group;
  113. X  {
  114. X      char buf[LEN];
  115. X      int killed = FALSE;
  116. --- 428,439 ----
  117. X      return (unkilled);
  118. X  }
  119. X  
  120. ! /*
  121. !  * Kill any articles in group active[index]
  122. !  */
  123. !  
  124. ! int kill_any_articles (index)
  125. !     int index;    /* active[index].name gets groupname */
  126. X  {
  127. X      char buf[LEN];
  128. X      int killed = FALSE;
  129. ***************
  130. *** 447,453 ****
  131. X      num_of_killed_arts = 0;
  132. X      num_of_hot_arts = 0;
  133. X  
  134. !     newsgroup_hash = hash_s (group);
  135. X  
  136. X      for (i=0 ; i < kill_num ; i++) {
  137. X          if (killf[i].kill_group == 0L ||
  138. --- 449,455 ----
  139. X      num_of_killed_arts = 0;
  140. X      num_of_hot_arts = 0;
  141. X  
  142. !     newsgroup_hash = hash_s (active[index].name);
  143. X  
  144. X      for (i=0 ; i < kill_num ; i++) {
  145. X          if (killf[i].kill_group == 0L ||
  146. ***************
  147. *** 476,484 ****
  148. X                  if (STR_MATCH (arts[i].subject, killf[j].kill_subj)) {
  149. X                      if (! is_hot) {
  150. X                          SET_KILLED(i);
  151. X                      } else {
  152. X                          SET_HOT(i);
  153. !                         if (show_only_unread) {
  154. X                              if (arts[i].unread == ART_UNREAD) {
  155. X                                  num_of_hot_arts++;
  156. X                              }
  157. --- 478,487 ----
  158. X                  if (STR_MATCH (arts[i].subject, killf[j].kill_subj)) {
  159. X                      if (! is_hot) {
  160. X                          SET_KILLED(i);
  161. +                         num_of_killed_arts++;
  162. X                      } else {
  163. X                          SET_HOT(i);
  164. !                         if (active[index].attribute.show_only_unread) {
  165. X                              if (arts[i].unread == ART_UNREAD) {
  166. X                                  num_of_hot_arts++;
  167. X                              }
  168. ***************
  169. *** 497,505 ****
  170. X                  if (STR_MATCH (buf, killf[j].kill_from)) {
  171. X                      if (! is_hot) {
  172. X                          SET_KILLED(i);
  173. X                      } else {
  174. X                          SET_HOT(i);
  175. !                         if (show_only_unread) {
  176. X                              if (arts[i].unread == ART_UNREAD) {
  177. X                                  num_of_hot_arts++;
  178. X                              }
  179. --- 500,509 ----
  180. X                  if (STR_MATCH (buf, killf[j].kill_from)) {
  181. X                      if (! is_hot) {
  182. X                          SET_KILLED(i);
  183. +                         num_of_killed_arts++;
  184. X                      } else {
  185. X                          SET_HOT(i);
  186. !                         if (active[index].attribute.show_only_unread) {
  187. X                              if (arts[i].unread == ART_UNREAD) {
  188. X                                  num_of_hot_arts++;
  189. X                              }
  190. ***************
  191. *** 513,521 ****
  192. X                  if (STR_MATCH (arts[i].subject, killf[j].kill_subj)) {
  193. X                      if (! is_hot) {
  194. X                          SET_KILLED(i);
  195. X                      } else {
  196. X                          SET_HOT(i);
  197. !                         if (show_only_unread) {
  198. X                              if (arts[i].unread == ART_UNREAD) {
  199. X                                  num_of_hot_arts++;
  200. X                              }
  201. --- 517,526 ----
  202. X                  if (STR_MATCH (arts[i].subject, killf[j].kill_subj)) {
  203. X                      if (! is_hot) {
  204. X                          SET_KILLED(i);
  205. +                         num_of_killed_arts++;
  206. X                      } else {
  207. X                          SET_HOT(i);
  208. !                         if (active[index].attribute.show_only_unread) {
  209. X                              if (arts[i].unread == ART_UNREAD) {
  210. X                                  num_of_hot_arts++;
  211. X                              }
  212. ***************
  213. *** 534,542 ****
  214. X                  if (STR_MATCH (buf, killf[j].kill_from)) {
  215. X                      if (! is_hot) {
  216. X                          SET_KILLED(i);
  217. X                      } else {
  218. X                          SET_HOT(i);
  219. !                         if (show_only_unread) {
  220. X                              if (arts[i].unread == ART_UNREAD) {
  221. X                                  num_of_hot_arts++;
  222. X                              }
  223. --- 539,548 ----
  224. X                  if (STR_MATCH (buf, killf[j].kill_from)) {
  225. X                      if (! is_hot) {
  226. X                          SET_KILLED(i);
  227. +                         num_of_killed_arts++;
  228. X                      } else {
  229. X                          SET_HOT(i);
  230. !                         if (active[index].attribute.show_only_unread) {
  231. X                              if (arts[i].unread == ART_UNREAD) {
  232. X                                  num_of_hot_arts++;
  233. X                              }
  234. ***************
  235. *** 567,575 ****
  236. X   * arguments.
  237. X   */
  238. X  
  239. ! int auto_select_articles (group)
  240. !     char *group;
  241. X  {
  242. !     kill_any_articles (group);
  243. X      return (TRUE);
  244. X  }
  245. --- 573,581 ----
  246. X   * arguments.
  247. X   */
  248. X  
  249. ! int auto_select_articles (index)
  250. !     int index;
  251. X  {
  252. !     kill_any_articles (index);
  253. X      return (TRUE);
  254. X  }
  255. diff -rcs ../1.14/lang.c ./lang.c
  256. *** ../1.14/lang.c    Tue Aug 11 21:23:10 1992
  257. --- ./lang.c    Mon Aug  3 08:19:54 1992
  258. ***************
  259. *** 3,9 ****
  260. X   *  Module    : lang.c
  261. X   *  Author    : I.Lea
  262. X   *  Created   : 01-04-91
  263. !  *  Updated   : 20-06-92
  264. X   *  Notes     :
  265. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  266. X   *              You may  freely  copy or  redistribute  this software,
  267. --- 3,9 ----
  268. X   *  Module    : lang.c
  269. X   *  Author    : I.Lea
  270. X   *  Created   : 01-04-91
  271. !  *  Updated   : 03-08-92
  272. X   *  Notes     :
  273. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  274. X   *              You may  freely  copy or  redistribute  this software,
  275. ***************
  276. *** 16,24 ****
  277. X   * active.c
  278. X   */
  279. X   
  280. ! char txt_subscribe_to_new_group[] = "Subscribe to %s (y/n): ";
  281. ! char txt_delete_bogus_group[] = "Remove bogus group %s (y/n): ";
  282. X  char txt_reading_active_file[] = "Reading active file...";
  283. X  char txt_reading_newsgroups_file[] = "Reading newsgroups file...";
  284. X  
  285. X  /*
  286. --- 16,25 ----
  287. X   * active.c
  288. X   */
  289. X   
  290. ! char txt_subscribe_to_new_group[] = "Subscribe to new group %s (y/n/q) [%c]: ";
  291. ! char txt_delete_bogus_group[] = "Remove bogus group %s (y/n/q) [%c]: ";
  292. X  char txt_reading_active_file[] = "Reading active file...";
  293. + char txt_reading_attributes_file[] = "Reading attributes file...";
  294. X  char txt_reading_newsgroups_file[] = "Reading newsgroups file...";
  295. X  
  296. X  /*
  297. ***************
  298. *** 26,32 ****
  299. X   */
  300. X  
  301. X  char txt_group[] = "Group %s...";
  302. ! char txt_cannot_open_art[] = "can't open article %s: ";
  303. X  char txt_indexing[] = "Indexing %s...";
  304. X  char txt_indexing_num[] = "Indexing %s...%4d";
  305. X  char txt_corrupt_index[] = "Index file %s corrupted. error %d on article %d";
  306. --- 27,33 ----
  307. X   */
  308. X  
  309. X  char txt_group[] = "Group %s...";
  310. ! char txt_cannot_open_art[] = "Can't open article %s: ";
  311. X  char txt_indexing[] = "Indexing %s...";
  312. X  char txt_indexing_num[] = "Indexing %s...%4d";
  313. X  char txt_corrupt_index[] = "Index file %s corrupted. error %d on article %d";
  314. ***************
  315. *** 34,39 ****
  316. --- 35,41 ----
  317. X  char txt_there_is_no_news[] = "There is no news\n";
  318. X  char txt_killing_arts[] = "Selecting articles...";
  319. X  char txt_unkilling_arts[] = "Unselecting articles...";
  320. + char txt_catchup_update_info[] = "%s %d group(s) in %ld seconds\n";
  321. X  
  322. X  /*
  323. X   *  feed.c
  324. ***************
  325. *** 40,46 ****
  326. X   */
  327. X  
  328. X  char txt_art_thread_regex_tag[] = " a)rticle, t)hread, h)ot, p)attern, T)agged articles, q)uit: ";
  329. ! char txt_post_process_type[] = "Process n)one, s)har, u)udecode, U)udecode & zoo: ";
  330. X  #ifdef NO_REGEX 
  331. X  char txt_feed_pattern[] = "Enter pattern [%s]> ";
  332. X  #else
  333. --- 42,48 ----
  334. X   */
  335. X  
  336. X  char txt_art_thread_regex_tag[] = " a)rticle, t)hread, h)ot, p)attern, T)agged articles, q)uit: ";
  337. ! char txt_post_process_type[] = "Process n)one, s)har, u)udecode, U)udecode & zoo, q)uit: ";
  338. X  #ifdef NO_REGEX 
  339. X  char txt_feed_pattern[] = "Enter pattern [%s]> ";
  340. X  #else
  341. ***************
  342. *** 86,96 ****
  343. X  char txt_no_match[] = "No match";
  344. X  char txt_post_subject[] = "Post subject [%s]> ";
  345. X  char txt_no_subject[] = "No subject";
  346. ! char txt_cannot_open[] = "can't open %s";
  347. X  char txt_posting[] = "Posting article...";
  348. X  char txt_art_posted[] = "-- Article posted --";
  349. X  char txt_art_rejected[] = "-- Article rejected (saved to %s) --";
  350. ! char txt_quit_edit_post[] = "q)uit, e)dit, p)ost: ";
  351. X  char txt_help_4[] = "4$       Goto spooldir 4 ($=goto last spooldir)\r\n";
  352. X  char txt_help_i_4[] = "4$       Goto article 4 ($=goto last article)\r\n";
  353. X  char txt_help_ctrl_k[] = "^K       Kill / Auto select (hot) current article\r\n";
  354. --- 88,98 ----
  355. X  char txt_no_match[] = "No match";
  356. X  char txt_post_subject[] = "Post subject [%s]> ";
  357. X  char txt_no_subject[] = "No subject";
  358. ! char txt_cannot_open[] = "Can't open %s";
  359. X  char txt_posting[] = "Posting article...";
  360. X  char txt_art_posted[] = "-- Article posted --";
  361. X  char txt_art_rejected[] = "-- Article rejected (saved to %s) --";
  362. ! char txt_quit_edit_post[] = "q)uit, e)dit, i)spell, p)ost: ";
  363. X  char txt_help_4[] = "4$       Goto spooldir 4 ($=goto last spooldir)\r\n";
  364. X  char txt_help_i_4[] = "4$       Goto article 4 ($=goto last article)\r\n";
  365. X  char txt_help_ctrl_k[] = "^K       Kill / Auto select (hot) current article\r\n";
  366. ***************
  367. *** 107,112 ****
  368. --- 109,115 ----
  369. X  char txt_help_a[] = "aA       Author forward (A=backward) search\r\n";
  370. X  char txt_help_sel_c[] = "cC       Mark group read (C=and goto next unread group)\r\n";
  371. X  char txt_help_c[] = "c        Mark all articles as read and goto group selection menu\r\n";
  372. + char txt_help_cC[] = "C        Mark all articles as read and goto next unread group\r\n";
  373. X  char txt_help_g[] = "g        Choose a new group by name\r\n";
  374. X  char txt_help_I[] = "I        Toggle inverse video\r\n";
  375. X  char txt_help_K[] = "K        Mark article/thread as read & goto next unread\r\n";
  376. ***************
  377. *** 195,208 ****
  378. X   *  misc.c
  379. X   */
  380. X  
  381. ! char txt_cannot_open_active_file[] = "Cannot open %s. Try %s -r to read news via NNTP.\n";
  382. X  char txt_active_file_is_empty[] = "%s contains no newsgroups. Exiting.";
  383. X  char txt_checking_active_file[] = "Checking for new newsgroups...";
  384. X  char txt_checking[] = "Checking...";
  385. ! char txt_cannot_find_base_art[] = "Cannot find base article %s";
  386. X  char txt_out_of_memory[] = "%s: out of memory";
  387. X  char txt_rename_error[] = "Error: rename %s to %s";
  388. X  char txt_shell_escape[] = "Enter shell command [%s]> ";
  389. X  
  390. X  /*
  391. X   *  newsrc.c
  392. --- 198,212 ----
  393. X   *  misc.c
  394. X   */
  395. X  
  396. ! char txt_cannot_open_active_file[] = "Can't open %s. Try %s -r to read news via NNTP.\n";
  397. X  char txt_active_file_is_empty[] = "%s contains no newsgroups. Exiting.";
  398. X  char txt_checking_active_file[] = "Checking for new newsgroups...";
  399. X  char txt_checking[] = "Checking...";
  400. ! char txt_cannot_find_base_art[] = "Can't find base article %s";
  401. X  char txt_out_of_memory[] = "%s: out of memory";
  402. X  char txt_rename_error[] = "Error: rename %s to %s";
  403. X  char txt_shell_escape[] = "Enter shell command [%s]> ";
  404. + char txt_ispell_define_not_compiled[] = "Interactive spellchecker not enabled. Recompile with -DUSE_ISPELL.";
  405. X  
  406. X  /*
  407. X   *  newsrc.c
  408. ***************
  409. *** 218,224 ****
  410. X  char txt_connecting[] = "Connecting to %s...";
  411. X  char txt_cannot_get_nntp_server_name[] = "Cannot find NNTP server name";
  412. X  char txt_server_name_in_file_env_var[] = "Put the server name in the file %s,\nor set the environment variable NNTPSERVER";
  413. ! char txt_failed_to_connect_to_server[] = "Failed to connect to (%s) server";
  414. X  char txt_rejected_by_nntpserver[] = "Rejected by server, nntp error %d";
  415. X  char txt_connection_to_server_broken[] = "Connection to server broken";
  416. X  char txt_stuff_nntp_cannot_open[] = "stuff_nntp: can't open %s: ";
  417. --- 222,228 ----
  418. X  char txt_connecting[] = "Connecting to %s...";
  419. X  char txt_cannot_get_nntp_server_name[] = "Cannot find NNTP server name";
  420. X  char txt_server_name_in_file_env_var[] = "Put the server name in the file %s,\nor set the environment variable NNTPSERVER";
  421. ! char txt_failed_to_connect_to_server[] = "Failed to connect to NNTP server %s. Exiting...";
  422. X  char txt_rejected_by_nntpserver[] = "Rejected by server, nntp error %d";
  423. X  char txt_connection_to_server_broken[] = "Connection to server broken";
  424. X  char txt_stuff_nntp_cannot_open[] = "stuff_nntp: can't open %s: ";
  425. ***************
  426. *** 259,265 ****
  427. X  char txt_help_ctrl_h[] = "^H       Show articles header\r\n";
  428. X  char txt_help_h[] = "h        Command help\r\n";
  429. X  char txt_help_i[] = "q        Return to previous level\r\n";
  430. ! char txt_help_ck[] = "ck       Mark thread as read & return to previous level\r\n";
  431. X  char txt_help_p_k[] = "kK       Mark article (K=thread) as read & advance to next unread\r\n";
  432. X  char txt_help_p_m[] = "m        Mail article/thread/hot/pattern/tagged articles to someone\r\n";
  433. X  char txt_help_p_n[] = "nN       Goto to the next (N=unread) article\r\n";
  434. --- 263,269 ----
  435. X  char txt_help_ctrl_h[] = "^H       Show articles header\r\n";
  436. X  char txt_help_h[] = "h        Command help\r\n";
  437. X  char txt_help_i[] = "q        Return to previous level\r\n";
  438. ! char txt_help_ck[] = "cK       Mark thread as read & return to previous level\r\n";
  439. X  char txt_help_p_k[] = "kK       Mark article (K=thread) as read & advance to next unread\r\n";
  440. X  char txt_help_p_m[] = "m        Mail article/thread/hot/pattern/tagged articles to someone\r\n";
  441. X  char txt_help_p_n[] = "nN       Goto to the next (N=unread) article\r\n";
  442. ***************
  443. *** 275,283 ****
  444. X  char txt_help_p_search[] = "/        Article forward search\r\n";
  445. X  char txt_help_p_star[] = "*        Select article\r\n";
  446. X  char txt_help_p_dot[] = ".        Toggle article selection\r\n";
  447. ! char txt_help_p_coma[] = "@        Reverse aarticle selections\r\n";
  448. X  char txt_help_p_tilda[] = "~        Undo all selections in thread\r\n";
  449. ! char txt_mail_art_to[] = "Mail article to [%.*s]> ";
  450. X  char txt_no_mail_address[] = "No mail address";
  451. X  char txt_quit_edit_send[] = "q)uit, e)dit, s)end";
  452. X  char txt_quit_edit_cancel[] = "q)uit, e)dit, c)ancel";
  453. --- 279,287 ----
  454. X  char txt_help_p_search[] = "/        Article forward search\r\n";
  455. X  char txt_help_p_star[] = "*        Select article\r\n";
  456. X  char txt_help_p_dot[] = ".        Toggle article selection\r\n";
  457. ! char txt_help_p_coma[] = "@        Reverse article selections\r\n";
  458. X  char txt_help_p_tilda[] = "~        Undo all selections in thread\r\n";
  459. ! char txt_mail_art_to[] = "Mail article(s) to [%.*s]> ";
  460. X  char txt_no_mail_address[] = "No mail address";
  461. X  char txt_quit_edit_send[] = "q)uit, e)dit, s)end";
  462. X  char txt_quit_edit_cancel[] = "q)uit, e)dit, c)ancel";
  463. ***************
  464. *** 288,295 ****
  465. X  char txt_resp_to_poster[] = "Responses have been directed to the poster. Post anyway? (y/n): ";
  466. X  char txt_resp_redirect[] = "Responses have been directed to the following newsgroups";
  467. X  char txt_continue[] = "Continue? (y/n): ";
  468. ! char txt_writes[] = "%s writes:\n";
  469. ! char txt_writes_name[] = "%s (%s) writes:\n";
  470. X  char txt_save_filename[] = "Save filename [%s]> ";
  471. X  char txt_art_not_saved[] = "-- Article not saved --";
  472. X  char txt_no_filename[] = "No filename";
  473. --- 292,299 ----
  474. X  char txt_resp_to_poster[] = "Responses have been directed to the poster. Post anyway? (y/n): ";
  475. X  char txt_resp_redirect[] = "Responses have been directed to the following newsgroups";
  476. X  char txt_continue[] = "Continue? (y/n): ";
  477. ! char txt_writes[] = "%s wrote:\n";
  478. ! char txt_writes_name[] = "%s (%s) wrote:\n";
  479. X  char txt_save_filename[] = "Save filename [%s]> ";
  480. X  char txt_art_not_saved[] = "-- Article not saved --";
  481. X  char txt_no_filename[] = "No filename";
  482. ***************
  483. *** 312,318 ****
  484. X  char txt_post_an_article[] = "Post an article...";
  485. X  char txt_post_a_followup[] = "Post a followup...";
  486. X  char txt_mail_bug_report[] = "Mail bug report...";
  487. ! char txt_crosspost_group[] = "Crosspost article to group(s) [%s]> ";
  488. X  char txt_no_group[] = "No group";
  489. X  char txt_crosspost_an_article[] = "Crossposting article...";
  490. X  char txt_mail_bug_report_confirm[] = "Mail bug report to %s%s? (y/n): ";
  491. --- 316,322 ----
  492. X  char txt_post_an_article[] = "Post an article...";
  493. X  char txt_post_a_followup[] = "Post a followup...";
  494. X  char txt_mail_bug_report[] = "Mail bug report...";
  495. ! char txt_crosspost_group[] = "Crosspost article(s) to group(s) [%s]> ";
  496. X  char txt_no_group[] = "No group";
  497. X  char txt_crosspost_an_article[] = "Crossposting article...";
  498. X  char txt_mail_bug_report_confirm[] = "Mail bug report to %s%s? (y/n): ";
  499. ***************
  500. *** 453,458 ****
  501. --- 457,463 ----
  502. X  char txt_help_g_tab[] =   "n<TAB>   Goto next group with unread news and enter it\r\n";
  503. X  char txt_help_n[] = "N        Goto next group with unread news\r\n";
  504. X  char txt_help_g_q[] = "qQ       Quit\r\n";
  505. + char txt_help_g_r[] = "r        Toggle display to show all / only unread subscribed to groups\r\n";
  506. X  char txt_help_W[] = "W        List articles posted by user\r\n";
  507. X  char txt_help_g_y[] = "y        Yank in subscribed/unsubscribed from .newsrc\r\n";
  508. X  char txt_help_g_z[] = "z        Mark current group as unread\r\n";
  509. ***************
  510. *** 467,472 ****
  511. --- 472,488 ----
  512. X  
  513. X  char txt_resizing_window[] = "resizing window";
  514. X  char txt_suspended_message[] = "\nStopped. Type 'fg' to restart TIN\n";
  515. + /*
  516. +  *  spooldir.c
  517. +  */
  518. + char txt_spooldirs_not_supported[] = "Multiple spooldirs are not supported";
  519. + char txt_no_spooldirs[] = "No spooldirs"; 
  520. + char txt_spooldir_server_error_1[] = "Server does not appear to support the spooldir command\n"; 
  521. + char txt_spooldir_server_error_2[] = "Reconfigure the news reader or the server & try again.\n"; 
  522. + char txt_cannot_change_spooldir[] = "%s: Cannot change to valid spooldir. Exiting..."; 
  523. + char txt_changing_sppoldir_to[] = "Changing spooldir to";
  524. X  
  525. X  /*
  526. X   *  thread.c
  527. diff -rcs ../1.14/main.c ./main.c
  528. *** ../1.14/main.c    Tue Aug 11 21:23:12 1992
  529. --- ./main.c    Sun Jul 26 17:15:41 1992
  530. ***************
  531. *** 3,9 ****
  532. X   *  Module    : main.c
  533. X   *  Author    : I.Lea & R.Skrenta
  534. X   *  Created   : 01-04-91
  535. !  *  Updated   : 04-06-92
  536. X   *  Notes     :
  537. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  538. X   *              You may  freely  copy or  redistribute  this software,
  539. --- 3,9 ----
  540. X   *  Module    : main.c
  541. X   *  Author    : I.Lea & R.Skrenta
  542. X   *  Created   : 01-04-91
  543. !  *  Updated   : 23-07-92
  544. X   *  Notes     :
  545. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  546. X   *              You may  freely  copy or  redistribute  this software,
  547. ***************
  548. *** 22,29 ****
  549. X      int argc;    
  550. X      char *argv[];
  551. X  {
  552. !     int created, i;
  553. !     int start_groupnum = 0;
  554. X  
  555. X      cmd_line = TRUE;
  556. X      debug = 0;    /* debug OFF */
  557. --- 22,28 ----
  558. X      int argc;    
  559. X      char *argv[];
  560. X  {
  561. !     int i, start_groupnum = 0;
  562. X  
  563. X      cmd_line = TRUE;
  564. X      debug = 0;    /* debug OFF */
  565. ***************
  566. *** 52,59 ****
  567. X  #endif
  568. X  
  569. X      /*
  570. !      * set up char *'s: homedir, newsrc, etc. 
  571. X       */
  572. X      init_selfinfo ();
  573. X  
  574. X      /*
  575. --- 51,60 ----
  576. X  #endif
  577. X  
  578. X      /*
  579. !      * set up initial array sizes, char *'s: homedir, newsrc, etc. 
  580. X       */
  581. +     init_alloc ();
  582. +     hash_init ();
  583. X      init_selfinfo ();
  584. X  
  585. X      /*
  586. ***************
  587. *** 70,84 ****
  588. X      nntp_open ();
  589. X  
  590. X      /*
  591. !      *  allocate initial array sizes
  592. X       */
  593. !     init_alloc ();
  594. !     hash_init ();
  595. X  
  596. X      /*
  597. !      *  load the active file into active[]
  598. X       */
  599. !     created = read_active_file ();
  600. X  
  601. X      /*
  602. X       * read text descriptions for each group from LIBDIR/newsgroups
  603. --- 71,84 ----
  604. X      nntp_open ();
  605. X  
  606. X      /*
  607. !      *  load the active file into active[]
  608. X       */
  609. !     read_active_file ();
  610. X  
  611. X      /*
  612. !      *  load the group specific attributes file into active[]
  613. X       */
  614. !     read_attributes_file ();
  615. X  
  616. X      /*
  617. X       * read text descriptions for each group from LIBDIR/newsgroups
  618. ***************
  619. *** 109,115 ****
  620. X      } else {
  621. X          backup_newsrc ();
  622. X          read_newsrc (TRUE);
  623. !         mark_unthreaded_groups ();
  624. X      }
  625. X  
  626. X      /*
  627. --- 109,115 ----
  628. X      } else {
  629. X          backup_newsrc ();
  630. X          read_newsrc (TRUE);
  631. !         toggle_my_groups (show_only_unread_groups);
  632. X      }
  633. X  
  634. X      /*
  635. ***************
  636. *** 152,166 ****
  637. X      set_win_size (&LINES, &COLS);
  638. X  
  639. X      /*
  640. !      *  check for any newly created newsgroups
  641. !      */
  642. !     if (notify_new_groups && ! created) {
  643. !         notify_groups ();
  644. !     }
  645. !     /*
  646. !      *  if first time print welcome screen
  647. !       and auto-subscribe
  648. X       *  to groups specified in /usr/lib/news/subscribe locally
  649. X       *  or via NNTP if reading news remotely (LIST SUBSCRIBE)
  650. X       */
  651. --- 152,158 ----
  652. X      set_win_size (&LINES, &COLS);
  653. X  
  654. X      /*
  655. !      *  if first time print welcome screen and auto-subscribe
  656. X       *  to groups specified in /usr/lib/news/subscribe locally
  657. X       *  or via NNTP if reading news remotely (LIST SUBSCRIBE)
  658. X       */
  659. ***************
  660. *** 168,176 ****
  661. X          show_intro_page ();
  662. X      }
  663. X      
  664. X      selection_index (start_groupnum);
  665. -     tin_done (0);
  666. X  }
  667. X  
  668. X  /*
  669. --- 160,169 ----
  670. X          show_intro_page ();
  671. X      }
  672. X      
  673. +     /*
  674. +      * main work loop
  675. +      */
  676. X      selection_index (start_groupnum);
  677. X  }
  678. X  
  679. X  /*
  680. ***************
  681. *** 186,192 ****
  682. X  #ifdef INDEX_DAEMON
  683. X      while ((ch = getopt (argc, argv, "D:f:hI:vV")) != EOF) {
  684. X  #else
  685. !     while ((ch = getopt (argc, argv, "cD:f:hHI:m:M:np:rRs:SuUvVzZ")) != EOF) {
  686. X  #endif
  687. X          switch (ch) {
  688. X              case 'c':
  689. --- 179,185 ----
  690. X  #ifdef INDEX_DAEMON
  691. X      while ((ch = getopt (argc, argv, "D:f:hI:vV")) != EOF) {
  692. X  #else
  693. !     while ((ch = getopt (argc, argv, "cD:f:hHI:m:M:p:qrRs:SuUvVzZ")) != EOF) {
  694. X  #endif
  695. X          switch (ch) {
  696. X              case 'c':
  697. ***************
  698. *** 229,244 ****
  699. X                  update = TRUE;
  700. X                  catchup = TRUE;
  701. X                  break;
  702. -             case 'n':
  703. -                 notify_new_groups = TRUE;
  704. -                 break;
  705. X              case 'p':
  706. X                  my_strncpy (cmd_line_printer, optarg, sizeof (cmd_line_printer));
  707. X                  default_printer = FALSE;
  708. X                  break;
  709. X  
  710. X              case 'r':    /* read news remotely from default NNTP server */
  711. X  #ifdef NNTP_ABLE            
  712. X                  read_news_via_nntp = TRUE;
  713. --- 222,236 ----
  714. X                  update = TRUE;
  715. X                  catchup = TRUE;
  716. X                  break;
  717. X              case 'p':
  718. X                  my_strncpy (cmd_line_printer, optarg, sizeof (cmd_line_printer));
  719. X                  default_printer = FALSE;
  720. X                  break;
  721. X  
  722. +             case 'q':
  723. +                 check_for_new_newsgroups = FALSE;
  724. +                 break;
  725. X              case 'r':    /* read news remotely from default NNTP server */
  726. X  #ifdef NNTP_ABLE            
  727. X                  read_news_via_nntp = TRUE;
  728. ***************
  729. *** 264,269 ****
  730. --- 256,262 ----
  731. X  
  732. X              case 'u':    /* update index files */
  733. X                  update = TRUE;
  734. +                 show_description = FALSE;
  735. X                  break;
  736. X  
  737. X              case 'U':    /* update index files in background */
  738. ***************
  739. *** 331,338 ****
  740. X  #ifndef INDEX_DAEMON
  741. X      error_message ("  -m dir   mailbox directory [default=%s]", default_maildir);
  742. X      error_message ("  -M user  mail new news to specified user (batch mode)", "");
  743. -     error_message ("  -n       notify user of any newly created newsgroups", "");
  744. X      error_message ("  -p file  print program with options [default=%s]", DEFAULT_PRINTER);
  745. X  #  if defined(NNTP_ABLE) && !defined(NNTP_ONLY)
  746. X      if (! read_news_via_nntp) {
  747. X          error_message ("  -r       read news remotely from default NNTP server", "");
  748. --- 324,331 ----
  749. X  #ifndef INDEX_DAEMON
  750. X      error_message ("  -m dir   mailbox directory [default=%s]", default_maildir);
  751. X      error_message ("  -M user  mail new news to specified user (batch mode)", "");
  752. X      error_message ("  -p file  print program with options [default=%s]", DEFAULT_PRINTER);
  753. +     error_message ("  -q       quick start by not checking for new newsgroups", "");
  754. X  #  if defined(NNTP_ABLE) && !defined(NNTP_ONLY)
  755. X      if (! read_news_via_nntp) {
  756. X          error_message ("  -r       read news remotely from default NNTP server", "");
  757. ***************
  758. *** 424,429 ****
  759. --- 417,423 ----
  760. X                      perror_message ("Failed to start background indexing process", "");
  761. X                      break;
  762. X                  case 0:        /* child process */    
  763. +                     create_index_lock_file (lock_file);
  764. X                      process_id = getpid ();
  765. X  #ifdef BSD
  766. X                      setpgrp (0, process_id);    /* reset process group leader to this process */
  767. ***************
  768. *** 444,452 ****
  769. X                      signal (SIGQUIT, SIG_IGN);    /* stop indexing being interrupted */            
  770. X                      signal (SIGALRM, SIG_IGN);    /* stop indexing resyning active file */            
  771. X                      nntp_open ();            /* connect server if we are using nntp */
  772. !                     thread_arts = FALSE;    /* stop threading to run faster */
  773. X                      do_update ();
  774. !                     nntp_close ();            /* connect server if we are using nntp */
  775. X                      exit (0);
  776. X                      break;
  777. X                  default:    /* parent process*/
  778. --- 438,447 ----
  779. X                      signal (SIGQUIT, SIG_IGN);    /* stop indexing being interrupted */            
  780. X                      signal (SIGALRM, SIG_IGN);    /* stop indexing resyning active file */            
  781. X                      nntp_open ();            /* connect server if we are using nntp */
  782. !                     default_thread_arts = FALSE;    /* stop threading to run faster */
  783. X                      do_update ();
  784. !                     unlink (lock_file);
  785. !                     nntp_close ();
  786. X                      exit (0);
  787. X                      break;
  788. X                  default:    /* parent process*/
  789. ***************
  790. *** 454,461 ****
  791. X              }    
  792. X              update = FALSE;
  793. X          } else {
  794. !             thread_arts = FALSE;    /* stop threading to run faster */
  795. X              do_update ();
  796. X              tin_done (0);
  797. X          }
  798. X      }
  799. --- 449,458 ----
  800. X              }    
  801. X              update = FALSE;
  802. X          } else {
  803. !             create_index_lock_file (lock_file);
  804. !             default_thread_arts = FALSE;    /* stop threading to run faster */
  805. X              do_update ();
  806. +             unlink (lock_file);
  807. X              tin_done (0);
  808. X          }
  809. X      }
  810. diff -rcs ../1.14/memory.c ./memory.c
  811. *** ../1.14/memory.c    Tue Aug 11 21:23:12 1992
  812. --- ./memory.c    Fri Jul 31 21:22:07 1992
  813. ***************
  814. *** 3,9 ****
  815. X   *  Module    : memory.c
  816. X   *  Author    : I.Lea & R.Skrenta
  817. X   *  Created   : 01-04-91
  818. !  *  Updated   : 03-06-92
  819. X   *  Notes     :
  820. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  821. X   *              You may  freely  copy or  redistribute  this software,
  822. --- 3,9 ----
  823. X   *  Module    : memory.c
  824. X   *  Author    : I.Lea & R.Skrenta
  825. X   *  Created   : 01-04-91
  826. !  *  Updated   : 31-07-92
  827. X   *  Notes     :
  828. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  829. X   *              You may  freely  copy or  redistribute  this software,
  830. ***************
  831. *** 14,26 ****
  832. X  
  833. X  #include    "tin.h"
  834. X  
  835. - int *my_group;                    /* .newsrc --> active[] */
  836. - int *unread;                    /* highest art read in group */
  837. - long *base;
  838. - struct group_t *active;            /* active file */
  839. - struct article_t *arts;
  840. X  
  841. X  /*
  842. X   *  Dynamic table management
  843. X   *  These settings are memory conservative:  small initial allocations
  844. X   *  and a 50% expansion on table overflow.  A fast vm system with
  845. --- 14,49 ----
  846. X  
  847. X  #include    "tin.h"
  848. X  
  849. X  
  850. X  /*
  851. +  * Dynamic arrays maximum & current sizes
  852. +  * num_* values are one past top of used part of array
  853. +  */
  854. + int max_active = 0;
  855. + int num_active = 0;
  856. + int max_active_size = 0;
  857. + int num_active_size = 0;
  858. + int max_art = 0;
  859. + int max_kill = 0;
  860. + int num_kill = 0;
  861. + int max_save = 0;
  862. + int num_save = 0;
  863. + int max_spooldir = 0;
  864. + int num_spooldir = 0;
  865. + /*
  866. +  * Dynamic arrays
  867. +  */
  868. + int *my_group;                /* .newsrc --> active[] */
  869. + long *base;                /* base articles for each thread */
  870. + struct group_t *active;            /* active newsgroups */
  871. + struct active_size_t *active_size;    /* active file sizes on differnet servers */
  872. + struct article_t *arts;            /* articles headers in current group */
  873. + struct save_t *save;            /* sorts articles before saving them */
  874. + struct spooldir_t *spooldirs;        /* spooldirs on NNTP server (cdrom) */
  875. + /*
  876. X   *  Dynamic table management
  877. X   *  These settings are memory conservative:  small initial allocations
  878. X   *  and a 50% expansion on table overflow.  A fast vm system with
  879. ***************
  880. *** 30,58 ****
  881. X  
  882. X  void init_alloc ()
  883. X  {
  884. X      max_active = DEFAULT_ACTIVE_NUM;
  885. !     max_art = DEFAULT_ARTICLE_NUM;
  886. X  
  887. X      active = (struct group_t *) my_malloc ((unsigned) sizeof(*active) * max_active);
  888. X      my_group = (int *) my_malloc ((unsigned) sizeof(int) * max_active);
  889. !     unread = (int *) my_malloc ((unsigned) sizeof(int) * max_active);
  890. X  
  891. X      arts = (struct article_t *) my_malloc ((unsigned) sizeof(*arts) * max_art);
  892. X      base = (long *) my_malloc ((unsigned) sizeof(long) * max_art);
  893. X  
  894. X      max_kill = DEFAULT_KILL_NUM;
  895. X      
  896. X      killf = (struct kill_t *) my_malloc ((unsigned) sizeof(*killf) * max_kill);
  897. X  
  898. X      max_save = DEFAULT_SAVE_NUM;
  899. X      
  900. X      save = (struct save_t *) my_malloc ((unsigned) sizeof(*save) * max_save);
  901. X  
  902. X      screen = (struct screen_t *) 0;
  903. X  }
  904. X  
  905. X  
  906. ! void expand_art()
  907. X  {
  908. X      max_art += max_art / 2;        /* increase by 50% */
  909. X  
  910. --- 53,102 ----
  911. X  
  912. X  void init_alloc ()
  913. X  {
  914. +     /*
  915. +      * active file arrays
  916. +      */
  917. X      max_active = DEFAULT_ACTIVE_NUM;
  918. !     max_active_size = DEFAULT_ACTIVE_SIZE_NUM;
  919. X  
  920. X      active = (struct group_t *) my_malloc ((unsigned) sizeof(*active) * max_active);
  921. +     active_size = (struct active_size_t *) my_malloc ((unsigned) sizeof(*active_size) * max_active_size);
  922. X      my_group = (int *) my_malloc ((unsigned) sizeof(int) * max_active);
  923. !     /*
  924. !      * article headers array
  925. !      */
  926. !     max_art = DEFAULT_ARTICLE_NUM;
  927. X  
  928. X      arts = (struct article_t *) my_malloc ((unsigned) sizeof(*arts) * max_art);
  929. X      base = (long *) my_malloc ((unsigned) sizeof(long) * max_art);
  930. X  
  931. +     /*
  932. +      * kill file array
  933. +      */
  934. X      max_kill = DEFAULT_KILL_NUM;
  935. X      
  936. X      killf = (struct kill_t *) my_malloc ((unsigned) sizeof(*killf) * max_kill);
  937. X  
  938. +     /*
  939. +      * save file array
  940. +      */
  941. X      max_save = DEFAULT_SAVE_NUM;
  942. X      
  943. X      save = (struct save_t *) my_malloc ((unsigned) sizeof(*save) * max_save);
  944. X  
  945. +     /*
  946. +      * spooldirs array
  947. +      */
  948. +     max_spooldir = DEFAULT_SPOOLDIR_NUM;
  949. +     spooldirs = (struct spooldir_t *) my_malloc ((unsigned) sizeof(*spooldirs) * max_spooldir);
  950. X      screen = (struct screen_t *) 0;
  951. X  }
  952. X  
  953. X  
  954. ! void expand_art ()
  955. X  {
  956. X      max_art += max_art / 2;        /* increase by 50% */
  957. X  
  958. ***************
  959. *** 61,99 ****
  960. X  }
  961. X  
  962. X  
  963. ! void expand_active()
  964. X  {
  965. X      max_active += max_active / 2;        /* increase by 50% */
  966. X  
  967. X      if (active == (struct group_t *) 0) {
  968. !         active = (struct group_t *) my_malloc ((unsigned) sizeof(*active) * max_active);
  969. !         my_group = (int *) my_malloc ((unsigned) sizeof(int) * max_active);
  970. !         unread = (int *) my_malloc ((unsigned) sizeof(int) * max_active);
  971. X      } else {
  972. X          active = (struct group_t *) my_realloc((char *) active,
  973. !                  (unsigned) sizeof(*active) * max_active);
  974. !         my_group = (int *) my_realloc((char *) my_group, (unsigned) sizeof(int) * max_active);
  975. !         unread = (int *) my_realloc((char *) unread, (unsigned) sizeof(int) * max_active);
  976. X      }
  977. X  }
  978. X  
  979. X  
  980. ! void expand_kill()
  981. X  {
  982. X      max_kill += max_kill / 2;        /* increase by 50% */
  983. X  
  984. !     killf = (struct kill_t *) my_realloc((char *) killf, (unsigned) sizeof(struct kill_t) * max_kill);
  985. X  }
  986. X  
  987. X  
  988. ! void expand_save()
  989. X  {
  990. X      max_save += max_save / 2;        /* increase by 50% */
  991. X  
  992. !     save = (struct save_t *) my_realloc((char *) save, (unsigned) sizeof(struct save_t) * max_save);
  993. X  }
  994. X  
  995. X  
  996. X  void init_screen_array (allocate)
  997. X      int allocate;
  998. X  {
  999. --- 105,161 ----
  1000. X  }
  1001. X  
  1002. X  
  1003. ! void expand_active ()
  1004. X  {
  1005. X      max_active += max_active / 2;        /* increase by 50% */
  1006. X  
  1007. X      if (active == (struct group_t *) 0) {
  1008. !         active = (struct group_t *) my_malloc ((unsigned) sizeof (*active) * max_active);
  1009. !         my_group = (int *) my_malloc ((unsigned) sizeof (int) * max_active);
  1010. X      } else {
  1011. X          active = (struct group_t *) my_realloc((char *) active,
  1012. !                  (unsigned) sizeof (*active) * max_active);
  1013. !         my_group = (int *) my_realloc((char *) my_group, (unsigned) sizeof (int) * max_active);
  1014. X      }
  1015. X  }
  1016. X  
  1017. X  
  1018. ! void expand_kill ()
  1019. X  {
  1020. X      max_kill += max_kill / 2;        /* increase by 50% */
  1021. X  
  1022. !     killf = (struct kill_t *) my_realloc((char *) killf, 
  1023. !         (unsigned) sizeof (struct kill_t) * max_kill);
  1024. X  }
  1025. X  
  1026. X  
  1027. ! void expand_save ()
  1028. X  {
  1029. X      max_save += max_save / 2;        /* increase by 50% */
  1030. X  
  1031. !     save = (struct save_t *) my_realloc((char *) save, 
  1032. !         (unsigned) sizeof (struct save_t) * max_save);
  1033. ! }
  1034. ! void expand_spooldirs ()
  1035. ! {
  1036. !     max_spooldir += max_spooldir / 2;    /* increase by 50% */
  1037. !     spooldirs = (struct spooldir_t *) my_realloc((char *) spooldirs, 
  1038. !         (unsigned) sizeof (struct spooldir_t) * max_spooldir);
  1039. X  }
  1040. X  
  1041. X  
  1042. + void expand_active_size ()
  1043. + {
  1044. +     max_active_size += max_active_size / 2;        /* increase by 50% */
  1045. +     active_size = (struct active_size_t *) my_realloc((char *) active_size, 
  1046. +         (unsigned) sizeof(struct active_size_t) * max_active_size);
  1047. + }
  1048. X  void init_screen_array (allocate)
  1049. X      int allocate;
  1050. X  {
  1051. ***************
  1052. *** 157,162 ****
  1053. --- 219,240 ----
  1054. X              save = (struct save_t *) 0;
  1055. X          }
  1056. X      }
  1057. +     if (spooldirs != (struct spooldir_t *) 0) {
  1058. +         free_spooldirs_array ();
  1059. +         if (spooldirs != (struct spooldir_t *) 0) {
  1060. +             free ((char *) spooldirs);
  1061. +             spooldirs = (struct spooldir_t *) 0;
  1062. +         }
  1063. +     }
  1064. +     if (active_size != (struct active_size_t *) 0) {
  1065. +         free_active_size_array ();
  1066. +         if (active_size != (struct active_size_t *) 0) {
  1067. +             free ((char *) active_size);
  1068. +             active_size = (struct active_size_t *) 0;
  1069. +         }
  1070. +     }
  1071. X  }
  1072. X  
  1073. X  
  1074. ***************
  1075. *** 189,194 ****
  1076. --- 267,300 ----
  1077. X  }
  1078. X  
  1079. X  
  1080. + void free_attributes_array ()
  1081. + {
  1082. +     register int i;
  1083. +     
  1084. +     for (i = 0 ; i < num_active ; i++) {
  1085. +         if (active[i].attribute.maildir != (char *) 0 &&
  1086. +             active[i].attribute.maildir != default_maildir) {
  1087. +             free ((char *) active[i].attribute.maildir);
  1088. +             active[i].attribute.maildir = (char *) 0;
  1089. +         }
  1090. +         if (active[i].attribute.savedir != (char *) 0 &&
  1091. +             active[i].attribute.savedir != default_savedir) {
  1092. +             free ((char *) active[i].attribute.savedir);
  1093. +             active[i].attribute.savedir = (char *) 0;
  1094. +         }
  1095. +         if (active[i].attribute.sigfile != (char *) 0 &&
  1096. +             active[i].attribute.sigfile != default_sigfile) {
  1097. +             free ((char *) active[i].attribute.sigfile);
  1098. +             active[i].attribute.sigfile = (char *) 0;
  1099. +         }
  1100. +         if (active[i].attribute.followup_to != (char *) 0) {
  1101. +             free ((char *) active[i].attribute.followup_to);
  1102. +             active[i].attribute.followup_to = (char *) 0;
  1103. +         }
  1104. +     }
  1105. + }
  1106. X  void free_active_arrays ()
  1107. X  {
  1108. X      register int i;
  1109. ***************
  1110. *** 198,209 ****
  1111. X          my_group = (int *) 0;
  1112. X      }
  1113. X  
  1114. !     if (unread != (int *) 0) {                /* unread[] */
  1115. !         free ((char *) unread);
  1116. !         unread = (int *) 0;
  1117. !     }
  1118. !     if (active != (struct group_t *) 0) {    /* active[] */
  1119. X          for (i=0 ; i < num_active ; i++) {
  1120. X              if (active[i].name != (char *) 0) {
  1121. X                  free ((char *) active[i].name);
  1122. --- 304,310 ----
  1123. X          my_group = (int *) 0;
  1124. X      }
  1125. X  
  1126. !     if (active != (struct group_t *) 0) {        /* active[] */
  1127. X          for (i=0 ; i < num_active ; i++) {
  1128. X              if (active[i].name != (char *) 0) {
  1129. X                  free ((char *) active[i].name);
  1130. ***************
  1131. *** 213,243 ****
  1132. X                  free ((char *) active[i].description);
  1133. X                  active[i].description = (char *) 0;
  1134. X              }
  1135. -             if (active[i].attribute.server != (char *) 0) {
  1136. -                 free ((char *) active[i].attribute.server);
  1137. -                 active[i].attribute.server = (char *) 0;
  1138. -             }
  1139. -             if (active[i].attribute.maildir != (char *) 0 &&
  1140. -                 active[i].attribute.maildir != default_maildir) {
  1141. -                 free ((char *) active[i].attribute.maildir);
  1142. -                 active[i].attribute.maildir = (char *) 0;
  1143. -             }
  1144. -             if (active[i].attribute.savedir != (char *) 0 &&
  1145. -                 active[i].attribute.savedir != default_savedir) {
  1146. -                 free ((char *) active[i].attribute.savedir);
  1147. -                 active[i].attribute.savedir = (char *) 0;
  1148. -             }
  1149. -             if (active[i].attribute.sigfile != (char *) 0 &&
  1150. -                 active[i].attribute.sigfile != default_sigfile) {
  1151. -                 free ((char *) active[i].attribute.sigfile);
  1152. -                 active[i].attribute.sigfile = (char *) 0;
  1153. -             }
  1154. X          }
  1155. X          if (active != (struct group_t *) 0) {
  1156. X              free ((char *) active);
  1157. X              active = (struct group_t *) 0;
  1158. X          }
  1159. X      }
  1160. X  }
  1161. X  
  1162. X  
  1163. --- 314,330 ----
  1164. X                  free ((char *) active[i].description);
  1165. X                  active[i].description = (char *) 0;
  1166. X              }
  1167. X          }
  1168. +         
  1169. +         free_attributes_array ();
  1170. +     
  1171. X          if (active != (struct group_t *) 0) {
  1172. X              free ((char *) active);
  1173. X              active = (struct group_t *) 0;
  1174. X          }
  1175. X      }
  1176. +     
  1177. +     num_active = 0;
  1178. X  }
  1179. X  
  1180. X  
  1181. ***************
  1182. *** 245,251 ****
  1183. X  {
  1184. X      int i;
  1185. X      
  1186. !     for (i=0 ; i < kill_num ; i++) {
  1187. X          if (killf[i].kill_subj != (char *) 0) {
  1188. X              free ((char *) killf[i].kill_subj);
  1189. X              killf[i].kill_subj = (char *) 0;
  1190. --- 332,338 ----
  1191. X  {
  1192. X      int i;
  1193. X      
  1194. !     for (i=0 ; i < num_kill ; i++) {
  1195. X          if (killf[i].kill_subj != (char *) 0) {
  1196. X              free ((char *) killf[i].kill_subj);
  1197. X              killf[i].kill_subj = (char *) 0;
  1198. ***************
  1199. *** 255,272 ****
  1200. X              killf[i].kill_from = (char *) 0;
  1201. X          }
  1202. X      }
  1203. - }
  1204. X  
  1205. X  
  1206. - /*
  1207. -  *  reset save list array to 0 and free's all its allocated memory
  1208. -  */
  1209. X   
  1210. X  void free_save_array ()
  1211. X  {
  1212. X      int i;
  1213. X      
  1214. !     for (i=0 ; i < save_num ; i++) {
  1215. X          if (save[i].subject != (char *) 0) {
  1216. X              free ((char *) save[i].subject);
  1217. X              save[i].subject = (char *) 0;
  1218. --- 342,357 ----
  1219. X              killf[i].kill_from = (char *) 0;
  1220. X          }
  1221. X      }
  1222. X  
  1223. +     num_kill = 0;
  1224. + }
  1225. X  
  1226. X   
  1227. X  void free_save_array ()
  1228. X  {
  1229. X      int i;
  1230. X      
  1231. !     for (i=0 ; i < num_save ; i++) {
  1232. X          if (save[i].subject != (char *) 0) {
  1233. X              free ((char *) save[i].subject);
  1234. X              save[i].subject = (char *) 0;
  1235. ***************
  1236. *** 296,302 ****
  1237. X          save[i].is_mailbox = FALSE;
  1238. X      }
  1239. X      
  1240. !     save_num = 0;
  1241. X  }
  1242. X  
  1243. X  
  1244. --- 381,426 ----
  1245. X          save[i].is_mailbox = FALSE;
  1246. X      }
  1247. X      
  1248. !     num_save = 0;
  1249. ! }
  1250. ! void free_spooldirs_array ()
  1251. ! {
  1252. !     int i;
  1253. !     
  1254. !     for (i=0 ; i < num_spooldir ; i++) {
  1255. !         if (spooldirs[i].name != (char *) 0) {
  1256. !             free ((char *) spooldirs[i].name);
  1257. !             spooldirs[i].name = (char *) 0;
  1258. !         }
  1259. !         if (spooldirs[i].comment != (char *) 0) {
  1260. !             free ((char *) spooldirs[i].comment);
  1261. !             spooldirs[i].comment = (char *) 0;
  1262. !         }
  1263. !         spooldirs[i].state = 0;
  1264. !     }
  1265. !     
  1266. !     num_spooldir = 0;
  1267. ! }
  1268. ! void free_active_size_array ()
  1269. ! {
  1270. !     int i;
  1271. !     
  1272. !     for (i=0 ; i < num_active_size ; i++) {
  1273. !         if (active_size[i].server != (char *) 0) {
  1274. !             free ((char *) active_size[i].server);
  1275. !             active_size[i].server = (char *) 0;
  1276. !         }
  1277. !         if (active_size[i].attribute != (char *) 0) {
  1278. !             free ((char *) active_size[i].attribute);
  1279. !             active_size[i].attribute = (char *) 0;
  1280. !         }
  1281. !     }
  1282. !     
  1283. !     num_active_size = 0;
  1284. X  }
  1285. X  
  1286. X  
  1287. diff -rcs ../1.14/misc.c ./misc.c
  1288. *** ../1.14/misc.c    Tue Aug 11 21:23:13 1992
  1289. --- ./misc.c    Tue Jul 28 08:35:27 1992
  1290. ***************
  1291. *** 3,9 ****
  1292. X   *  Module    : misc.c
  1293. X   *  Author    : I.Lea & R.Skrenta
  1294. X   *  Created   : 01-04-91
  1295. !  *  Updated   : 20-06-92
  1296. X   *  Notes     :
  1297. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  1298. X   *              You may  freely  copy or  redistribute  this software,
  1299. --- 3,9 ----
  1300. X   *  Module    : misc.c
  1301. X   *  Author    : I.Lea & R.Skrenta
  1302. X   *  Created   : 01-04-91
  1303. !  *  Updated   : 23-07-92
  1304. X   *  Notes     :
  1305. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  1306. X   *              You may  freely  copy or  redistribute  this software,
  1307. ***************
  1308. *** 85,93 ****
  1309. X  int invoke_editor (nam)
  1310. X      char *nam;
  1311. X  {
  1312. !     char buf[LEN];
  1313. X      char *my_editor;
  1314. !     static char editor[LEN];
  1315. X      static int first = TRUE;
  1316. X  
  1317. X      if (first) {
  1318. --- 85,93 ----
  1319. X  int invoke_editor (nam)
  1320. X      char *nam;
  1321. X  {
  1322. !     char buf[PATH_LEN];
  1323. X      char *my_editor;
  1324. !     static char editor[PATH_LEN];
  1325. X      static int first = TRUE;
  1326. X  
  1327. X      if (first) {
  1328. ***************
  1329. *** 109,114 ****
  1330. --- 109,142 ----
  1331. X  }
  1332. X  
  1333. X  
  1334. + int invoke_ispell (nam)
  1335. +     char *nam;
  1336. + {
  1337. + #ifdef USE_ISPELL
  1338. +     char buf[PATH_LEN];
  1339. +     char *my_ispell;
  1340. +     static char ispell[PATH_LEN];
  1341. +     static int first = TRUE;
  1342. +     if (first) {
  1343. +         my_ispell = (char *) getenv ("ISPELL");
  1344. +         strcpy (ispell, my_ispell != NULL ? my_ispell : "ispell -x");
  1345. +         first = FALSE;
  1346. +     }
  1347. +     sprintf (buf, "%s %s", ispell, nam);
  1348. +     wait_message (buf);
  1349. +     return invoke_cmd (buf);
  1350. + #else
  1351. +     error_message (txt_ispell_define_not_compiled, "");
  1352. +     return FALSE;
  1353. + #endif
  1354. + }
  1355. X  void shell_escape ()
  1356. X  {
  1357. X      char shell[LEN];
  1358. ***************
  1359. *** 116,122 ****
  1360. X  
  1361. X  #ifdef SIGTSTP
  1362. X      sigtype_t (*susp)();
  1363. !     susp = (sigtype_t *) 0;
  1364. X  #endif
  1365. X  
  1366. X      sprintf (msg, txt_shell_escape, default_shell_command);
  1367. --- 144,150 ----
  1368. X  
  1369. X  #ifdef SIGTSTP
  1370. X      sigtype_t (*susp)();
  1371. !     susp = (sigtype_t (*)()) 0;
  1372. X  #endif
  1373. X  
  1374. X      sprintf (msg, txt_shell_escape, default_shell_command);
  1375. ***************
  1376. *** 184,194 ****
  1377. X       */
  1378. X      if (catchup_read_groups) {
  1379. X          for (i = 0 ; i < group_top ; i++) {
  1380. !             if (active[my_group[i]].attribute.read) {
  1381. X                  if (ask) {
  1382. X                      if (prompt_yn (LINES, "Catchup all groups entered during this session? (y/n): ", 'n')) {
  1383. X                          ask = FALSE;
  1384. !                         thread_arts = FALSE;    /* speeds up index loading */
  1385. X                      } else {
  1386. X                          break;
  1387. X                      }
  1388. --- 212,222 ----
  1389. X       */
  1390. X      if (catchup_read_groups) {
  1391. X          for (i = 0 ; i < group_top ; i++) {
  1392. !             if (active[my_group[i]].attribute.read_during_session) {
  1393. X                  if (ask) {
  1394. X                      if (prompt_yn (LINES, "Catchup all groups entered during this session? (y/n): ", 'n')) {
  1395. X                          ask = FALSE;
  1396. !                         default_thread_arts = FALSE;    /* speeds up index loading */
  1397. X                      } else {
  1398. X                          break;
  1399. X                      }
  1400. ***************
  1401. *** 219,228 ****
  1402. X          unlink (index_file);
  1403. X      }
  1404. X  
  1405. - #ifdef INDEX_DAEMON
  1406. -     unlink (LOCK_FILE);
  1407. - #endif
  1408. X      exit (ret);
  1409. X  }
  1410. X  
  1411. --- 247,252 ----
  1412. ***************
  1413. *** 249,262 ****
  1414. X  long hash_groupname (group)
  1415. X      char *group;
  1416. X  {
  1417. !     unsigned long hash_value;
  1418. X      unsigned char *ptr = (unsigned char *) group;
  1419. X  
  1420. !     hash_value = *ptr++;
  1421. !     while (*ptr)
  1422. !         hash_value = ((hash_value << 1) ^ *ptr++) % TABLE_SIZE;
  1423. X  
  1424. X      return (hash_value);
  1425. X  }
  1426. X  
  1427. --- 273,287 ----
  1428. X  long hash_groupname (group)
  1429. X      char *group;
  1430. X  {
  1431. !     unsigned long hash_value = 0L;
  1432. X      unsigned char *ptr = (unsigned char *) group;
  1433. X  
  1434. !     if (*ptr) {
  1435. !         hash_value = *ptr++;
  1436. X  
  1437. +         while (*ptr)
  1438. +             hash_value = ((hash_value << 1) ^ *ptr++) % TABLE_SIZE;
  1439. +     }
  1440. X      return (hash_value);
  1441. X  }
  1442. X  
  1443. ***************
  1444. *** 317,323 ****
  1445. X      int ret;
  1446. X  #ifdef SIGTSTP
  1447. X      sigtype_t (*susp)();
  1448. !     susp = (sigtype_t *) 0;
  1449. X  #endif
  1450. X  
  1451. X      set_alarm_clock_off ();
  1452. --- 342,348 ----
  1453. X      int ret;
  1454. X  #ifdef SIGTSTP
  1455. X      sigtype_t (*susp)();
  1456. !     susp = (sigtype_t (*)()) 0;
  1457. X  #endif
  1458. X  
  1459. X      set_alarm_clock_off ();
  1460. ***************
  1461. *** 330,336 ****
  1462. X          susp = signal(SIGTSTP, SIG_DFL);
  1463. X  #endif
  1464. X  
  1465. ! #ifdef SIGCHLD
  1466. X      system (nam);
  1467. X      ret = system_status;
  1468. X  #else
  1469. --- 355,361 ----
  1470. X          susp = signal(SIGTSTP, SIG_DFL);
  1471. X  #endif
  1472. X  
  1473. ! #if defined(SIGCHLD) && !defined(AIX)
  1474. X      system (nam);
  1475. X      ret = system_status;
  1476. X  #else
  1477. ***************
  1478. *** 778,807 ****
  1479. X  }
  1480. X  
  1481. X  
  1482. X  void get_author (thread, respnum, str)
  1483. X      int thread;
  1484. X      int respnum;
  1485. X      char *str;
  1486. X  {    
  1487. X      extern int threaded_on_subject;
  1488. X      int author;
  1489. - /*
  1490. -     int len_from = max_from;
  1491. X  
  1492. X      if (thread) {
  1493. X          if (threaded_on_subject) {
  1494. -             len_from = max_subj+max_from;
  1495. -         } else {
  1496. -             len_from = max_from;
  1497. -         }
  1498. -         author = SHOW_FROM_BOTH;
  1499. -     } else {
  1500. -         author = show_author;
  1501. -     } 
  1502. - */
  1503. -     if (thread) {
  1504. -         if (threaded_on_subject) {
  1505. X              author = SHOW_FROM_BOTH;
  1506. X          } else {
  1507. X              author = show_author;
  1508. --- 803,819 ----
  1509. X  }
  1510. X  
  1511. X  
  1512. X  void get_author (thread, respnum, str)
  1513. X      int thread;
  1514. X      int respnum;
  1515. X      char *str;
  1516. X  {    
  1517. +     extern int cur_groupnum;
  1518. X      extern int threaded_on_subject;
  1519. X      int author;
  1520. X  
  1521. X      if (thread) {
  1522. X          if (threaded_on_subject) {
  1523. X              author = SHOW_FROM_BOTH;
  1524. X          } else {
  1525. X              author = show_author;
  1526. ***************
  1527. *** 901,903 ****
  1528. --- 913,951 ----
  1529. X              return KEYMAP_UNKNOWN;
  1530. X      }
  1531. X  }
  1532. + /*
  1533. +  * Check for lock file to stop multiple copies of tind or tin -U running 
  1534. +  * and if it does not exist create it so this is the only copy running
  1535. +  */
  1536. + void create_index_lock_file (lock_file)
  1537. +     char *lock_file;
  1538. + {
  1539. +     char buf[32];
  1540. +     FILE *fp;
  1541. +     long epoch;
  1542. +     struct stat sb;
  1543. +     if (stat (lock_file, &sb) == 0) {
  1544. +         if ((fp = fopen (lock_file, "r")) != (FILE *) 0) {
  1545. +             fgets (buf, sizeof (buf), fp);
  1546. +             fclose (fp);
  1547. + #ifdef INDEX_DAEMON
  1548. +             sprintf (msg, "%s: Already started pid=[%d] on %s", 
  1549. +                 progname, atoi(buf), buf+8);
  1550. + #else
  1551. +             sprintf (msg, "\n%s: Already started pid=[%d] on %s", 
  1552. +                 progname, atoi(buf), buf+8);
  1553. + #endif
  1554. +             error_message (msg, "");
  1555. +             exit (1);
  1556. +         }
  1557. +     } else     if ((fp = fopen (lock_file, "w")) != (FILE *) 0) {
  1558. +         time (&epoch);
  1559. +         fprintf (fp, "%6d  %s\n", process_id, ctime (&epoch));
  1560. +         fclose (fp);
  1561. +         chmod (lock_file, 0600);
  1562. +     }
  1563. + }
  1564. diff -rcs ../1.14/newsrc.c ./newsrc.c
  1565. *** ../1.14/newsrc.c    Tue Aug 11 21:23:14 1992
  1566. --- ./newsrc.c    Sun Jul 26 16:36:17 1992
  1567. ***************
  1568. *** 3,9 ****
  1569. X   *  Module    : newsrc.c
  1570. X   *  Author    : I.Lea & R.Skrenta
  1571. X   *  Created   : 01-04-91
  1572. !  *  Updated   : 19-04-92
  1573. X   *  Notes     :
  1574. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  1575. X   *              You may  freely  copy or  redistribute  this software,
  1576. --- 3,9 ----
  1577. X   *  Module    : newsrc.c
  1578. X   *  Author    : I.Lea & R.Skrenta
  1579. X   *  Created   : 01-04-91
  1580. !  *  Updated   : 26-07-92
  1581. X   *  Notes     :
  1582. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  1583. X   *              You may  freely  copy or  redistribute  this software,
  1584. ***************
  1585. *** 72,78 ****
  1586. X  /*
  1587. X   *  Read $HOME/.newsrc into my_group[]. my_group[] ints point to
  1588. X   *  active[] entries.  Sub_only determines  whether to just read
  1589. !  *  subscribed groups or all of them.
  1590. X   */
  1591. X  
  1592. X  void read_newsrc (sub_only)
  1593. --- 72,78 ----
  1594. X  /*
  1595. X   *  Read $HOME/.newsrc into my_group[]. my_group[] ints point to
  1596. X   *  active[] entries.  Sub_only determines  whether to just read
  1597. !  *  subscribed groups or all of them. 
  1598. X   */
  1599. X  
  1600. X  void read_newsrc (sub_only)
  1601. ***************
  1602. *** 89,96 ****
  1603. X  
  1604. X  reread_newsrc:
  1605. X  
  1606. !     if ((fp = fopen (newsrc, "r")) == NULL) {    /* attempt to make a .newsrc */
  1607. !         if (auto_subscribe_groups ()) {        /* attempt to auto create newsrc */
  1608. X              goto reread_newsrc;
  1609. X          }    
  1610. X          for (i = 0; i < num_active; i++) {
  1611. --- 89,99 ----
  1612. X  
  1613. X  reread_newsrc:
  1614. X  
  1615. !     /* 
  1616. !      * make a .newsrc if one does not exist & auto subscribe to set groups
  1617. !      */
  1618. !     if ((fp = fopen (newsrc, "r")) == NULL) {
  1619. !         if (auto_subscribe_groups ()) {
  1620. X              goto reread_newsrc;
  1621. X          }    
  1622. X          for (i = 0; i < num_active; i++) {
  1623. ***************
  1624. *** 98,105 ****
  1625. X                  expand_active ();
  1626. X              }
  1627. X              my_group[group_top] = i;
  1628. !             active[i].flag = 0;
  1629. !             unread[group_top] = -1;
  1630. X              group_top++;
  1631. X          }
  1632. X          write_newsrc ();
  1633. --- 101,108 ----
  1634. X                  expand_active ();
  1635. X              }
  1636. X              my_group[group_top] = i;
  1637. !             active[i].my_group = 0;
  1638. !             active[i].unread = -1;
  1639. X              group_top++;
  1640. X          }
  1641. X          write_newsrc ();
  1642. ***************
  1643. *** 115,124 ****
  1644. X          c = *p;
  1645. X          *p++ = '\0';
  1646. X  
  1647. !         if (c == '!' && sub_only)
  1648. X              continue;        /* unsubscribed */
  1649. !         if ((i = add_group (buf, FALSE)) < 0) {
  1650. X              if (! remove_old_groups) {
  1651. X                  if ((fp_old = fopen (old_groups, "w")) == NULL) {
  1652. X                      perror_message (txt_cannot_open, old_groups);
  1653. --- 118,130 ----
  1654. X          c = *p;
  1655. X          *p++ = '\0';
  1656. X  
  1657. !         if (c == '!' && sub_only) {
  1658. X              continue;        /* unsubscribed */
  1659. !         }
  1660. !         
  1661. !         i = add_group (buf, FALSE);
  1662. !         
  1663. !         if (i < 0) {
  1664. X              if (! remove_old_groups) {
  1665. X                  if ((fp_old = fopen (old_groups, "w")) == NULL) {
  1666. X                      perror_message (txt_cannot_open, old_groups);
  1667. ***************
  1668. *** 130,139 ****
  1669. X              continue;
  1670. X          }
  1671. X  
  1672. !         if (c != '!')        /* if we're subscribed to it */
  1673. !             active[my_group[i]].flag |= SUBSCRIBED;
  1674. !         unread[i] = parse_unread (p, my_group[i]);
  1675. X      }
  1676. X      fclose (fp);
  1677. X  
  1678. --- 136,146 ----
  1679. X              continue;
  1680. X          }
  1681. X  
  1682. !         if (c != '!') {        /* if we're subscribed to it */
  1683. !             active[my_group[i]].my_group |= SUBSCRIBED;
  1684. !         }
  1685. !         
  1686. !         active[my_group[i]].unread = parse_unread (p, my_group[i]);
  1687. X      }
  1688. X      fclose (fp);
  1689. X  
  1690. ***************
  1691. *** 331,339 ****
  1692. X      int gotit = FALSE;
  1693. X  
  1694. X      if (ch == '!')
  1695. !         active[num].flag &= ~SUBSCRIBED;
  1696. X      else
  1697. !         active[num].flag |= SUBSCRIBED;
  1698. X  
  1699. X      if ((newfp = fopen (newnewsrc, "w")) == NULL)
  1700. X          goto subscribe_done;
  1701. --- 338,346 ----
  1702. X      int gotit = FALSE;
  1703. X  
  1704. X      if (ch == '!')
  1705. !         active[num].my_group &= ~SUBSCRIBED;
  1706. X      else
  1707. !         active[num].my_group |= SUBSCRIBED;
  1708. X  
  1709. X      if ((newfp = fopen (newnewsrc, "w")) == NULL)
  1710. X          goto subscribe_done;
  1711. ***************
  1712. *** 425,432 ****
  1713. X      rename_file (newnewsrc, newsrc);
  1714. X  
  1715. X  update_done:
  1716. !     for (i = 0; i < group_top; i++)
  1717. !         unread[i] = -1;
  1718. X  }
  1719. X  
  1720. X  
  1721. --- 432,440 ----
  1722. X      rename_file (newnewsrc, newsrc);
  1723. X  
  1724. X  update_done:
  1725. !     for (i = 0; i < group_top; i++) {
  1726. !         active[my_group[i]].unread = -1;
  1727. !     }    
  1728. X  }
  1729. X  
  1730. X  
  1731. ***************
  1732. *** 498,510 ****
  1733. X      int i, j;
  1734. X      char c;
  1735. X  
  1736. !     if ((del = fopen(delgroups, "r")) == NULL) {
  1737. X          return FALSE;
  1738. X      }
  1739. X  
  1740. !     unlink(delgroups);
  1741. X      
  1742. !     if ((newfp = fopen(delgroups, "w")) == NULL) {
  1743. X          return FALSE;
  1744. X      }
  1745. X  
  1746. --- 506,518 ----
  1747. X      int i, j;
  1748. X      char c;
  1749. X  
  1750. !     if ((del = fopen (delgroups, "r")) == NULL) {
  1751. X          return FALSE;
  1752. X      }
  1753. X  
  1754. !     unlink (delgroups);
  1755. X      
  1756. !     if ((newfp = fopen (delgroups, "w")) == NULL) {
  1757. X          return FALSE;
  1758. X      }
  1759. X  
  1760. ***************
  1761. *** 511,524 ****
  1762. X      buf[0][0] = '\0';
  1763. X      buf[1][0] = '\0';
  1764. X  
  1765. !     while (fgets(buf[which], sizeof (buf[which]), del) != NULL) {
  1766. X          which = !which;
  1767. X          if (*buf[which])
  1768. !             fputs(buf[which], newfp);
  1769. X      }
  1770. X  
  1771. !     fclose(del);
  1772. !     fclose(newfp);
  1773. X      which = !which;
  1774. X  
  1775. X      if (!*buf[which]) {
  1776. --- 519,532 ----
  1777. X      buf[0][0] = '\0';
  1778. X      buf[1][0] = '\0';
  1779. X  
  1780. !     while (fgets (buf[which], sizeof (buf[which]), del) != NULL) {
  1781. X          which = !which;
  1782. X          if (*buf[which])
  1783. !             fputs (buf[which], newfp);
  1784. X      }
  1785. X  
  1786. !     fclose (del);
  1787. !     fclose (newfp);
  1788. X      which = !which;
  1789. X  
  1790. X      if (!*buf[which]) {
  1791. ***************
  1792. *** 542,568 ****
  1793. X      h = hash_groupname (buf[which]);
  1794. X  
  1795. X      for (i = group_hash[h]; i >= 0; i = active[i].next) {
  1796. !         if (strcmp(buf[which], active[i].name) == 0) {
  1797. X              for (j = 0; j < group_top; j++)
  1798. X                  if (my_group[j] == i) {
  1799. X                      return j;
  1800. X                  }
  1801. X  
  1802. !             active[i].flag &= ~UNSUBSCRIBED;   /* mark that we got it */
  1803. X              if (c != '!')
  1804. !                 active[i].flag |= SUBSCRIBED;
  1805. X  
  1806. X              if (group_top >= max_active)
  1807. X                  expand_active ();
  1808. X              group_top++;
  1809. X              for (j = group_top; j > cur_groupnum; j--) {
  1810. X                  my_group[j] = my_group[j-1];
  1811. -                 unread[j] = unread[j-1];
  1812. X              }
  1813. X              my_group[cur_groupnum] = i;
  1814. !             unread[cur_groupnum] = parse_unread(p, i);
  1815. X  
  1816. !             if ((fp = fopen(newsrc, "r")) == NULL) {
  1817. X                  return FALSE;
  1818. X              }
  1819. X              if ((newfp = fopen(newnewsrc, "w")) == NULL) {
  1820. --- 550,577 ----
  1821. X      h = hash_groupname (buf[which]);
  1822. X  
  1823. X      for (i = group_hash[h]; i >= 0; i = active[i].next) {
  1824. !         if (strcmp (buf[which], active[i].name) == 0) {
  1825. X              for (j = 0; j < group_top; j++)
  1826. X                  if (my_group[j] == i) {
  1827. X                      return j;
  1828. X                  }
  1829. X  
  1830. !             active[i].my_group &= ~UNSUBSCRIBED;   /* mark that we got it */
  1831. X              if (c != '!')
  1832. !                 active[i].my_group |= SUBSCRIBED;
  1833. X  
  1834. X              if (group_top >= max_active)
  1835. X                  expand_active ();
  1836. X              group_top++;
  1837. X              for (j = group_top; j > cur_groupnum; j--) {
  1838. + /* FIXME delete            activeunread[j] = unread[j-1];
  1839. + */
  1840. X                  my_group[j] = my_group[j-1];
  1841. X              }
  1842. X              my_group[cur_groupnum] = i;
  1843. !             active[i].unread = parse_unread (p, i);
  1844. X  
  1845. !             if ((fp = fopen (newsrc, "r")) == NULL) {
  1846. X                  return FALSE;
  1847. X              }
  1848. X              if ((newfp = fopen(newnewsrc, "w")) == NULL) {
  1849. ***************
  1850. *** 864,870 ****
  1851. X      /*
  1852. X       *  resort into required sort order
  1853. X       */
  1854. !     switch (sort_art_type) {
  1855. X          case SORT_BY_NOTHING:        /* already sorted above */
  1856. X              break;
  1857. X          case SORT_BY_SUBJ_DESCEND:
  1858. --- 873,879 ----
  1859. X      /*
  1860. X       *  resort into required sort order
  1861. X       */
  1862. !     switch (default_sort_art_type) {
  1863. X          case SORT_BY_NOTHING:        /* already sorted above */
  1864. X              break;
  1865. X          case SORT_BY_SUBJ_DESCEND:
  1866. diff -rcs ../1.14/nntplib.c ./nntplib.c
  1867. *** ../1.14/nntplib.c    Tue Aug 11 21:23:15 1992
  1868. --- ./nntplib.c    Mon Jul 20 12:51:09 1992
  1869. ***************
  1870. *** 3,9 ****
  1871. X   *  Module    : nntplib.c
  1872. X   *  Author    : S.Barber & I.Lea
  1873. X   *  Created   : 12-01-91
  1874. !  *  Updated   : 06-05-92
  1875. X   *  Notes     : NNTP client routines taken from clientlib.c v1.6
  1876. X   *              1.5.11 (10 February 1991)
  1877. X   *  Copyright : (c) Copyright 1991-92 by Stan Barber & Iain Lea
  1878. --- 3,9 ----
  1879. X   *  Module    : nntplib.c
  1880. X   *  Author    : S.Barber & I.Lea
  1881. X   *  Created   : 12-01-91
  1882. !  *  Updated   : 01-07-92
  1883. X   *  Notes     : NNTP client routines taken from clientlib.c v1.6
  1884. X   *              1.5.11 (10 February 1991)
  1885. X   *  Copyright : (c) Copyright 1991-92 by Stan Barber & Iain Lea
  1886. ***************
  1887. *** 18,24 ****
  1888. X  #include "tin.h"
  1889. X  
  1890. X  #ifdef NNTP_ONLY
  1891. ! #    define    NNTP_ABLE
  1892. X  #endif
  1893. X  
  1894. X  #ifndef CDROM_ABLE
  1895. --- 18,26 ----
  1896. X  #include "tin.h"
  1897. X  
  1898. X  #ifdef NNTP_ONLY
  1899. ! #    ifndef NNTP_ABLE
  1900. ! #        define    NNTP_ABLE
  1901. ! #    endif
  1902. X  #endif
  1903. X  
  1904. X  #ifndef CDROM_ABLE
  1905. ***************
  1906. *** 100,109 ****
  1907. X      register char    *cp;
  1908. X      static char    buf[256];
  1909. X  
  1910. -     if (debug == 1) {
  1911. -         wait_message ("USING BUILTIN NNTP");
  1912. -     }
  1913. -     
  1914. X      if (cp = (char *) getenv ("NNTPSERVER")) {
  1915. X          (void) strcpy (buf, cp);
  1916. X          return (buf);
  1917. --- 102,107 ----
  1918. ***************
  1919. *** 333,339 ****
  1920. X          hp = &def;
  1921. X      }
  1922. X      if (hp == NULL) {
  1923. !         fprintf (stderr, "%s: Unknown host.\n", machine);
  1924. X          return (-1);
  1925. X      }
  1926. X  
  1927. --- 331,337 ----
  1928. X          hp = &def;
  1929. X      }
  1930. X      if (hp == NULL) {
  1931. !         fprintf (stderr, "\n%s: Unknown host.\n", machine);
  1932. X          return (-1);
  1933. X      }
  1934. X  
  1935. ***************
  1936. *** 369,386 ****
  1937. X          bcopy(*cp, (char *) &sin.sin_addr, hp->h_length);
  1938. X          
  1939. X          if (x < 0) {
  1940. !             fprintf (stderr, "trying %s\n", (char *) inet_ntoa (sin.sin_addr));
  1941. X          }
  1942. X          x = connect (s, (struct sockaddr *) &sin, sizeof (sin));
  1943. X          if (x == 0) {
  1944. X              break;
  1945. X          }
  1946. !         fprintf (stderr, "connection to %s: ", (char *) inet_ntoa (sin.sin_addr));
  1947. X          perror ("");
  1948. X          (void) close (s);
  1949. X      }
  1950. X      if (x < 0) {
  1951. !         fprintf (stderr, "giving up...\n");
  1952. X          return (-1);
  1953. X      }
  1954. X  #else    /* no name server */
  1955. --- 367,384 ----
  1956. X          bcopy(*cp, (char *) &sin.sin_addr, hp->h_length);
  1957. X          
  1958. X          if (x < 0) {
  1959. !             fprintf (stderr, "Trying %s", (char *) inet_ntoa (sin.sin_addr));
  1960. X          }
  1961. X          x = connect (s, (struct sockaddr *) &sin, sizeof (sin));
  1962. X          if (x == 0) {
  1963. X              break;
  1964. X          }
  1965. !         fprintf (stderr, "\nConnection to %s: ", (char *) inet_ntoa (sin.sin_addr));
  1966. X          perror ("");
  1967. X          (void) close (s);
  1968. X      }
  1969. X      if (x < 0) {
  1970. !         fprintf (stderr, "Giving up...\n");
  1971. X          return (-1);
  1972. X      }
  1973. X  #else    /* no name server */
  1974. ***************
  1975. *** 396,402 ****
  1976. X      /* set up addr for the connect */
  1977. X  
  1978. X      if ((sin.sin_addr.s_addr = rhost (&machine)) == -1) {
  1979. !         fprintf (stderr, "%s: Unknown host.\n", machine);
  1980. X          return (-1);
  1981. X      }
  1982. X      /* And then connect */
  1983. --- 394,400 ----
  1984. X      /* set up addr for the connect */
  1985. X  
  1986. X      if ((sin.sin_addr.s_addr = rhost (&machine)) == -1) {
  1987. !         fprintf (stderr, "\n%s: Unknown host.\n", machine);
  1988. X          return (-1);
  1989. X      }
  1990. X      /* And then connect */
  1991. ***************
  1992. *** 598,605 ****
  1993. X  #ifdef NNTP_ABLE
  1994. X      register char *cp;
  1995. X  
  1996. !     if (fgets (string, size, ser_rd_fp) == NULL) {
  1997. !         return (-1);
  1998. X      }
  1999. X  
  2000. X      if ((cp = (char *) index(string, '\r')) != NULL) {
  2001. --- 596,605 ----
  2002. X  #ifdef NNTP_ABLE
  2003. X      register char *cp;
  2004. X  
  2005. !     while (fgets (string, size, ser_rd_fp) == NULL) {
  2006. !         if (errno != EINTR) {
  2007. !             return (-1);
  2008. !         }    
  2009. X      }
  2010. X  
  2011. X      if ((cp = (char *) index(string, '\r')) != NULL) {
  2012. Files ../1.14/nntplib.h and ./nntplib.h are identical
  2013. diff -rcs ../1.14/open.c ./open.c
  2014. *** ../1.14/open.c    Tue Aug 11 21:23:16 1992
  2015. --- ./open.c    Sat Aug  1 18:00:01 1992
  2016. ***************
  2017. *** 3,9 ****
  2018. X   *  Module    : open.c
  2019. X   *  Author    : I.Lea & R.Skrenta
  2020. X   *  Created   : 01-04-91
  2021. !  *  Updated   : 04-06-92
  2022. X   *  Notes     : reads news locally (ie. /usr/spool/news) or via NNTP
  2023. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  2024. X   *              You may  freely  copy or  redistribute  this software,
  2025. --- 3,9 ----
  2026. X   *  Module    : open.c
  2027. X   *  Author    : I.Lea & R.Skrenta
  2028. X   *  Created   : 01-04-91
  2029. !  *  Updated   : 01-08-92
  2030. X   *  Notes     : reads news locally (ie. /usr/spool/news) or via NNTP
  2031. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  2032. X   *              You may  freely  copy or  redistribute  this software,
  2033. ***************
  2034. *** 51,89 ****
  2035. X  int    can_post = TRUE;
  2036. X  #endif
  2037. X  
  2038. ! char server_name[LEN];
  2039. X  
  2040. X  void nntp_open ()
  2041. X  {
  2042. X  #ifdef NNTP_ABLE    
  2043. -     char *server;
  2044. X      int ret;
  2045. X  
  2046. X      if (read_news_via_nntp) {
  2047. X          debug_nntp ("nntp_open", "BEGIN");
  2048. X  
  2049. !         if (nntp_server[0]) {
  2050. !             server = nntp_server;
  2051. !         } else {
  2052. !             server = getserverbyfile (NNTP_SERVER_FILE);
  2053. !         }
  2054. X  
  2055. !         if (server == (char *) 0) {
  2056. X              error_message (txt_cannot_get_nntp_server_name, "");
  2057. X              error_message (txt_server_name_in_file_env_var, NNTP_SERVER_FILE);
  2058. !             exit(1);
  2059. X          }
  2060. X  
  2061. X          if (update == FALSE) {
  2062. !             sprintf (msg, txt_connecting, server);
  2063. X              wait_message (msg);
  2064. X          }
  2065. X          
  2066. !         debug_nntp ("nntp_open", server);
  2067. X  
  2068. !         ret = server_init (server);
  2069. !         if (update == FALSE) {
  2070. X              fputc ('\n', stdout);
  2071. X          }
  2072. X  
  2073. --- 51,83 ----
  2074. X  int    can_post = TRUE;
  2075. X  #endif
  2076. X  
  2077. ! char *nntp_server;
  2078. X  
  2079. X  void nntp_open ()
  2080. X  {
  2081. X  #ifdef NNTP_ABLE    
  2082. X      int ret;
  2083. X  
  2084. X      if (read_news_via_nntp) {
  2085. X          debug_nntp ("nntp_open", "BEGIN");
  2086. X  
  2087. !         nntp_server = getserverbyfile (NNTP_SERVER_FILE);
  2088. X  
  2089. !         if (nntp_server == (char *) 0) {
  2090. X              error_message (txt_cannot_get_nntp_server_name, "");
  2091. X              error_message (txt_server_name_in_file_env_var, NNTP_SERVER_FILE);
  2092. !             exit (1);
  2093. X          }
  2094. X  
  2095. X          if (update == FALSE) {
  2096. !             sprintf (msg, txt_connecting, nntp_server);
  2097. X              wait_message (msg);
  2098. X          }
  2099. X          
  2100. !         debug_nntp ("nntp_open", nntp_server);
  2101. X  
  2102. !         ret = server_init (nntp_server);
  2103. !         if (update == FALSE && ret != -1) {
  2104. X              fputc ('\n', stdout);
  2105. X          }
  2106. X  
  2107. ***************
  2108. *** 101,107 ****
  2109. X              break;    
  2110. X  
  2111. X          case -1:
  2112. !             error_message (txt_failed_to_connect_to_server, server);
  2113. X              exit (1);
  2114. X  
  2115. X          default:
  2116. --- 95,101 ----
  2117. X              break;    
  2118. X  
  2119. X          case -1:
  2120. !             error_message (txt_failed_to_connect_to_server, nntp_server);
  2121. X              exit (1);
  2122. X  
  2123. X          default:
  2124. ***************
  2125. *** 179,184 ****
  2126. --- 173,207 ----
  2127. X  }
  2128. X  
  2129. X  
  2130. + FILE *open_newgroups_fp (index)
  2131. +     int index;
  2132. + {
  2133. +     char line[NNTP_STRLEN];
  2134. +     
  2135. +     if (read_news_via_nntp) {
  2136. + #ifdef NNTP_ABLE
  2137. +         if (index == -1) {
  2138. +             return (FILE *) 0;
  2139. +         }
  2140. +         sprintf (line, "newgroups %s", active_size[index].attribute);
  2141. +         debug_nntp ("open_newgroups_fp", line);
  2142. +         put_server (line);
  2143. +         if (get_respcode () != OK_NEWGROUPS) {
  2144. +             debug_nntp ("open_newgroups_fp", "NOT_OK");
  2145. +             return (FILE *) 0;
  2146. +         }
  2147. +         debug_nntp ("open_newgroups_fp", "OK");
  2148. +         return nntp_to_fp ();
  2149. + #else
  2150. +         return (FILE *) 0;
  2151. + #endif        
  2152. +     } else {
  2153. +         sprintf (line, "%s/active", rcdir);
  2154. +         return fopen (line, "r");
  2155. +     }
  2156. + }
  2157. X  FILE *open_subscription_fp ()
  2158. X  {
  2159. X      if (read_news_via_nntp) {
  2160. ***************
  2161. *** 247,253 ****
  2162. X      char *group_path;
  2163. X      long art;
  2164. X  {
  2165. !     char buf[LEN];
  2166. X      int respcode;
  2167. X      struct stat sb;
  2168. X      extern long note_size;
  2169. --- 270,276 ----
  2170. X      char *group_path;
  2171. X      long art;
  2172. X  {
  2173. !     char buf[NNTP_STRLEN];
  2174. X      int respcode;
  2175. X      struct stat sb;
  2176. X      extern long note_size;
  2177. ***************
  2178. *** 286,292 ****
  2179. X      char *group_path;
  2180. X      long art;
  2181. X  {
  2182. !     char buf[LEN];
  2183. X      
  2184. X      if (read_news_via_nntp) {
  2185. X  #ifdef NNTP_ABLE    
  2186. --- 309,315 ----
  2187. X      char *group_path;
  2188. X      long art;
  2189. X  {
  2190. !     char buf[NNTP_STRLEN];
  2191. X      
  2192. X      if (read_news_via_nntp) {
  2193. X  #ifdef NNTP_ABLE    
  2194. ***************
  2195. *** 340,346 ****
  2196. X      char *group;
  2197. X      char *group_path;
  2198. X  {
  2199. !     char buf[LEN];
  2200. X  #ifdef NNTP_ABLE
  2201. X      char line[NNTP_STRLEN];
  2202. X  #endif
  2203. --- 363,369 ----
  2204. X      char *group;
  2205. X      char *group_path;
  2206. X  {
  2207. !     char buf[NNTP_STRLEN];
  2208. X  #ifdef NNTP_ABLE
  2209. X      char line[NNTP_STRLEN];
  2210. X  #endif
  2211. ***************
  2212. *** 482,488 ****
  2213. X  FILE *nntp_to_fp ()
  2214. X  {
  2215. X  #ifdef NNTP_ABLE
  2216. !     char fnam[LEN];
  2217. X      FILE *fp = (FILE *) 0;
  2218. X      
  2219. X      if (! stuff_nntp (fnam)) {
  2220. --- 505,511 ----
  2221. X  FILE *nntp_to_fp ()
  2222. X  {
  2223. X  #ifdef NNTP_ABLE
  2224. !     char fnam[PATH_LEN];
  2225. X      FILE *fp = (FILE *) 0;
  2226. X      
  2227. X      if (! stuff_nntp (fnam)) {
  2228. diff -rcs ../1.14/page.c ./page.c
  2229. *** ../1.14/page.c    Tue Aug 11 21:23:17 1992
  2230. --- ./page.c    Fri Aug  7 18:48:19 1992
  2231. SHAR_EOF
  2232. true || echo 'restore of tin-1.15.patch failed'
  2233. fi
  2234. echo 'End of tin-1.15 part 4'
  2235. echo 'File tin-1.15.patch is continued in part 5'
  2236. echo 5 > _shar_seq_.tmp
  2237. exit 0
  2238.  
  2239. --
  2240. NAME   Iain Lea 
  2241. EMAIL  iain%anl433.uucp@Germany.EU.net
  2242. SNAIL  Siemens AG, ANL A433SZ, Gruendlacher Str. 248, 8510 Fuerth, Germany.
  2243. PHONE  +49-911-3089-407 (work) +49-911-331963 (home) +49-911-3089-290 (FAX)  
  2244. exit 0 # Just in case...
  2245.