home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sources / misc / 3812 < prev    next >
Encoding:
Text File  |  1992-08-15  |  60.8 KB  |  2,300 lines

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