home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume26 / tin / patch06b < prev    next >
Encoding:
Text File  |  1991-11-29  |  54.0 KB  |  1,826 lines

  1. Newsgroups: comp.sources.misc
  2. From: iain@estevax.uucp (Iain J. Lea)
  3. Subject:  v26i077:  tin - threaded full screen newsreader, Patch06b/5
  4. Message-ID: <1991Nov30.023929.14484@sparky.imd.sterling.com>
  5. X-Md4-Signature: 48ddf0922bb8e24537680e0e949ed17d
  6. Date: Sat, 30 Nov 1991 02:39:29 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: iain@estevax.uucp (Iain J. Lea)
  10. Posting-number: Volume 26, Issue 77
  11. Archive-name: tin/patch06b
  12. Environment: BSD, SCO, ISC, SUNOS, SYSVR3, SYSVR4, ULTRIX, XENIX
  13. Patch-To: tin: Volume 23, Issue 15-23
  14.  
  15. #!/bin/sh
  16. # this is patch06.shar.02 (part 2 of tin)
  17. # do not concatenate these parts, unpack them in order with /bin/sh
  18. # file tin.patch06 continued
  19. #
  20. if touch 2>&1 | fgrep '[-amc]' > /dev/null
  21.  then TOUCH=touch
  22.  else TOUCH=true
  23. fi
  24. if test ! -r shar3_seq_.tmp; then
  25.     echo "Please unpack part 1 first!"
  26.     exit 1
  27. fi
  28. (read Scheck
  29.  if test "$Scheck" != 2; then
  30.     echo "Please unpack part $Scheck next!"
  31.     exit 1
  32.  else
  33.     exit 0
  34.  fi
  35. ) < shar3_seq_.tmp || exit 1
  36. echo "x - Continuing file tin.patch06"
  37. sed 's/^X//' << 'SHAR_EOF' >> tin.patch06 &&
  38. X      int orig_note_end;
  39. X      int orig_note_page;
  40. X+     int patlen;
  41. X      int ret1 = FALSE;
  42. X      int ret2 = FALSE;
  43. X      int redraw_screen = FALSE;
  44. X***************
  45. X*** 153,160 ****
  46. X              break;
  47. X          case FEED_PRINT:    
  48. X              if (default_printer) {
  49. X!                 sprintf (command, "%s -P%s > /dev/null 2>&1",
  50. X!                     printer, get_val ("PRINTER","ps0"));
  51. X              } else {
  52. X                  sprintf (command, "%s > /dev/null 2>&1", printer);
  53. X              }
  54. X--- 153,165 ----
  55. X              break;
  56. X          case FEED_PRINT:    
  57. X              if (default_printer) {
  58. X! #ifdef SINIX
  59. X!                     sprintf (command, "%s -dru=%s > /dev/null 2>&1",
  60. X!                         printer, get_val ("PRINTER","ps0"));
  61. X! #else
  62. X!                     sprintf (command, "%s -P%s > /dev/null 2>&1",
  63. X!                         printer, get_val ("PRINTER","ps0"));
  64. X! #endif
  65. X              } else {
  66. X                  sprintf (command, "%s > /dev/null 2>&1", printer);
  67. X              }
  68. X***************
  69. X*** 214,221 ****
  70. X                          if ((proc_ch = ReadCh ()) == CR)
  71. X                              proc_ch = proc_ch_default;
  72. X                      } while (proc_ch != 'n' && proc_ch != 's' &&
  73. X!                             proc_ch != 'u' && proc_ch != 'U' &&
  74. X!                             proc_ch != 'p');
  75. X                  }
  76. X              }
  77. X              clear_message ();
  78. X--- 219,225 ----
  79. X                          if ((proc_ch = ReadCh ()) == CR)
  80. X                              proc_ch = proc_ch_default;
  81. X                      } while (proc_ch != 'n' && proc_ch != 's' &&
  82. X!                             proc_ch != 'u' && proc_ch != 'U');
  83. X                  }
  84. X              }
  85. X              clear_message ();
  86. X***************
  87. X*** 240,246 ****
  88. X                      if (print_header) {
  89. X                          fseek(note_fp, 0L, 0);
  90. X                      } else {
  91. X!                         fprintf (fp, "From: %s\n", note_h_from);
  92. X                          fprintf (fp, "Subject: %s\n", note_h_subj);
  93. X                          fprintf (fp, "Date: %s\n\n", note_h_date);
  94. X                          fseek (note_fp, note_mark[0], 0);
  95. X--- 244,251 ----
  96. X                      if (print_header) {
  97. X                          fseek(note_fp, 0L, 0);
  98. X                      } else {
  99. X!                         fprintf (fp, "From: %s (%s)\n",
  100. X!                             arts[respnum].from,arts[respnum].name);
  101. X                          fprintf (fp, "Subject: %s\n", note_h_subj);
  102. X                          fprintf (fp, "Date: %s\n\n", note_h_date);
  103. X                          fseek (note_fp, note_mark[0], 0);
  104. X***************
  105. X*** 251,257 ****
  106. X                  case FEED_SAVE:
  107. X                      wait_message (txt_saving);
  108. X                      add_to_save_list (0, &arts[respnum], is_mailbox, file);
  109. X!                     (void) save_art_to_file (respnum, 0, FALSE, "");
  110. X                      break;
  111. X              }
  112. X              if (level == GROUP_LEVEL) {
  113. X--- 256,262 ----
  114. X                  case FEED_SAVE:
  115. X                      wait_message (txt_saving);
  116. X                      add_to_save_list (0, &arts[respnum], is_mailbox, file);
  117. X!                     (void) save_art_to_file (respnum, 0, FALSE, (char *) 0);
  118. X                      break;
  119. X              }
  120. X              if (level == GROUP_LEVEL) {
  121. X***************
  122. X*** 285,291 ****
  123. X                          if (print_header) {
  124. X                              fseek(note_fp, 0L, 0);
  125. X                          } else {
  126. X!                             fprintf (fp, "From: %s\n", note_h_from);
  127. X                              fprintf (fp, "Subject: %s\n", note_h_subj);
  128. X                              fprintf (fp, "Date: %s\n\n", note_h_date);
  129. X                              fseek (note_fp, note_mark[0], 0);
  130. X--- 290,297 ----
  131. X                          if (print_header) {
  132. X                              fseek(note_fp, 0L, 0);
  133. X                          } else {
  134. X!                             fprintf (fp, "From: %s (%s)\n",
  135. X!                                 arts[respnum].from,arts[respnum].name);
  136. X                              fprintf (fp, "Subject: %s\n", note_h_subj);
  137. X                              fprintf (fp, "Date: %s\n\n", note_h_date);
  138. X                              fseek (note_fp, note_mark[0], 0);
  139. X***************
  140. X*** 297,302 ****
  141. X--- 303,309 ----
  142. X                          add_to_save_list (i, &arts[i], is_mailbox, file);
  143. X                          break;
  144. X                  }
  145. X+                 art_close ();
  146. X              }
  147. X              if (function == FEED_SAVE) {
  148. X                  sort_save_list ();
  149. X***************
  150. X*** 332,338 ****
  151. X                                  if (print_header) {
  152. X                                      fseek(note_fp, 0L, 0);
  153. X                                  } else {
  154. X!                                     fprintf (fp, "From: %s\n", note_h_from);
  155. X                                      fprintf (fp, "Subject: %s\n", note_h_subj);
  156. X                                      fprintf (fp, "Date: %s\n\n", note_h_date);
  157. X                                      fseek (note_fp, note_mark[0], 0);
  158. X--- 339,346 ----
  159. X                                  if (print_header) {
  160. X                                      fseek(note_fp, 0L, 0);
  161. X                                  } else {
  162. X!                                     fprintf (fp, "From: %s (%s)\n",
  163. X!                                         arts[respnum].from,arts[respnum].name);
  164. X                                      fprintf (fp, "Subject: %s\n", note_h_subj);
  165. X                                      fprintf (fp, "Date: %s\n\n", note_h_date);
  166. X                                      fseek (note_fp, note_mark[0], 0);
  167. X***************
  168. X*** 344,349 ****
  169. X--- 352,358 ----
  170. X                                  add_to_save_list (j, &arts[j], is_mailbox, file);
  171. X                                  break;
  172. X                          }
  173. X+                         art_close ();
  174. X                      }
  175. X                  }
  176. X              }
  177. X***************
  178. X*** 353,361 ****
  179. X              break;
  180. X  
  181. X          case 'r':         /* regex pattern matched articles */
  182. X              for (i=0 ; i < top ; i++) {
  183. X  #ifdef DONT_USE_REGEX 
  184. X!                 if (str_str (arts[i].subject, pattern) != 0) {
  185. X  #else        
  186. X                  if (wildmat (arts[i].subject, pattern)) {
  187. X  #endif        
  188. X--- 362,371 ----
  189. X              break;
  190. X  
  191. X          case 'r':         /* regex pattern matched articles */
  192. X+             patlen = strlen (pattern);
  193. X              for (i=0 ; i < top ; i++) {
  194. X  #ifdef DONT_USE_REGEX 
  195. X!                 if (str_str (arts[i].subject, pattern, patlen) != 0) {
  196. X  #else        
  197. X                  if (wildmat (arts[i].subject, pattern)) {
  198. X  #endif        
  199. X***************
  200. X*** 383,389 ****
  201. X                              if (print_header) {
  202. X                                  fseek(note_fp, 0L, 0);
  203. X                              } else {
  204. X!                                 fprintf (fp, "From: %s\n", note_h_from);
  205. X                                  fprintf (fp, "Subject: %s\n", note_h_subj);
  206. X                                  fprintf (fp, "Date: %s\n\n", note_h_date);
  207. X                                  fseek (note_fp, note_mark[0], 0);
  208. X--- 393,400 ----
  209. X                              if (print_header) {
  210. X                                  fseek(note_fp, 0L, 0);
  211. X                              } else {
  212. X!                                 fprintf (fp, "From: %s (%s)\n",
  213. X!                                     arts[respnum].from,arts[respnum].name);
  214. X                                  fprintf (fp, "Subject: %s\n", note_h_subj);
  215. X                                  fprintf (fp, "Date: %s\n\n", note_h_date);
  216. X                                  fseek (note_fp, note_mark[0], 0);
  217. X***************
  218. X*** 395,400 ****
  219. X--- 406,412 ----
  220. X                              add_to_save_list (i, &arts[i], is_mailbox, file);
  221. X                              break;
  222. X                      }
  223. X+                      art_close ();
  224. X                  }
  225. X              }
  226. X              if (function == FEED_SAVE) {                
  227. Xdiff -rcs ../105/group.c ./group.c
  228. X*** ../105/group.c    Wed Oct 16 20:00:23 1991
  229. X--- ./group.c    Mon Nov  4 18:11:09 1991
  230. X***************
  231. X*** 3,9 ****
  232. X   *  Module    : group.c
  233. X   *  Author    : R.Skrenta / I.Lea
  234. X   *  Created   : 01-04-91
  235. X!  *  Updated   : 16-10-91
  236. X   *  Release   : 1.0
  237. X   *  Notes     :
  238. X   *  Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
  239. X--- 3,9 ----
  240. X   *  Module    : group.c
  241. X   *  Author    : R.Skrenta / I.Lea
  242. X   *  Created   : 01-04-91
  243. X!  *  Updated   : 04-11-91
  244. X   *  Release   : 1.0
  245. X   *  Notes     :
  246. X   *  Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
  247. X***************
  248. X*** 38,43 ****
  249. X--- 38,44 ----
  250. X      long old_artnum;
  251. X      int old_top;
  252. X      int sav_groupnum;
  253. X+     int scroll_lines;
  254. X      int thread_marked_unread = FALSE;
  255. X  
  256. X      active[my_group[cur_groupnum]].read = TRUE;
  257. X***************
  258. X*** 55,60 ****
  259. X--- 56,66 ----
  260. X      index_group (group, group_path);    /* update index file */
  261. X      read_newsrc_line (group);            /* get sequencer information */
  262. X  
  263. X+     if (show_only_unread) {
  264. X+         make_threads (FALSE);
  265. X+         find_base (show_only_unread);
  266. X+     }
  267. X+ 
  268. X      if (space_mode) {
  269. X          for (i = 0; i < top_base; i++) {
  270. X              if (new_responses (i)) {
  271. X***************
  272. X*** 69,74 ****
  273. X--- 75,83 ----
  274. X      } else {
  275. X          index_point = top_base - 1;
  276. X      }
  277. X+     if (index_point < 0) {
  278. X+         index_point = 0;
  279. X+     }
  280. X      
  281. X      clear_note_area ();
  282. X  
  283. X***************
  284. X*** 95,101 ****
  285. X                  
  286. X              case '-':    /* go to last viewed article */
  287. X                  if (this_resp < 0) {
  288. X!                     info_message(txt_no_last_message);
  289. X                      break;
  290. X                  }
  291. X                  index_point = show_page (this_resp, group, group_path);
  292. X--- 104,110 ----
  293. X                  
  294. X              case '-':    /* go to last viewed article */
  295. X                  if (this_resp < 0) {
  296. X!                     info_message (txt_no_last_message);
  297. X                      break;
  298. X                  }
  299. X                  index_point = show_page (this_resp, group, group_path);
  300. X***************
  301. X*** 201,219 ****
  302. X              case ctrl('D'):        /* vi style */
  303. X              case ctrl('V'):        /* emacs style */
  304. X  group_page_down:
  305. X!                 if (!top_base || index_point == top_base - 1)
  306. X                      break;
  307. X  
  308. X!                 erase_subject_arrow();
  309. X!                 index_point += NOTESLINES / 2;
  310. X!                 if (index_point >= top_base)
  311. X!                     index_point = top_base - 1;
  312. X! 
  313. X                  if (index_point < first_subj_on_screen
  314. X                  || index_point >= last_subj_on_screen)
  315. X!                     show_group_page(group);
  316. X                  else
  317. X!                     draw_subject_arrow();
  318. X                  break;
  319. X  
  320. X              case ctrl('K'):        /* kill article */
  321. X--- 210,232 ----
  322. X              case ctrl('D'):        /* vi style */
  323. X              case ctrl('V'):        /* emacs style */
  324. X  group_page_down:
  325. X!                 if (! top_base || index_point == top_base - 1)
  326. X                      break;
  327. X  
  328. X!                 erase_subject_arrow ();
  329. X!                 scroll_lines = (full_page_scroll ? NOTESLINES : NOTESLINES / 2);
  330. X!                 index_point = ((index_point + scroll_lines) / scroll_lines) * scroll_lines;
  331. X!                 if (index_point >= top_base) {
  332. X!                     index_point = (top_base / scroll_lines) * scroll_lines;
  333. X!                     if (index_point < top_base - 1) {
  334. X!                         index_point = top_base - 1;
  335. X!                     }
  336. X!                 }
  337. X                  if (index_point < first_subj_on_screen
  338. X                  || index_point >= last_subj_on_screen)
  339. X!                     show_group_page (group);
  340. X                  else
  341. X!                     draw_subject_arrow ();
  342. X                  break;
  343. X  
  344. X              case ctrl('K'):        /* kill article */
  345. X***************
  346. X*** 248,254 ****
  347. X              case ctrl('N'):
  348. X              case 'j':        /* line down */
  349. X  group_down:
  350. X!                 if (!top_base || index_point + 1 >= top_base)
  351. X                      break;
  352. X  
  353. X                  if (index_point + 1 >= last_subj_on_screen) {
  354. X--- 261,267 ----
  355. X              case ctrl('N'):
  356. X              case 'j':        /* line down */
  357. X  group_down:
  358. X!                 if (! top_base || index_point + 1 >= top_base)
  359. X                      break;
  360. X  
  361. X                  if (index_point + 1 >= last_subj_on_screen) {
  362. X***************
  363. X*** 283,309 ****
  364. X              case ctrl('U'):        /* page up */
  365. X              case 'b':
  366. X  group_page_up:
  367. X!                 if (!top_base)
  368. X                      break;
  369. X  
  370. X  #ifndef USE_CLEARSCREEN
  371. X                  clear_message ();
  372. X  #endif
  373. X!                 erase_subject_arrow();
  374. X!                 index_point -= NOTESLINES / 2;
  375. X!                 if (index_point < 0)
  376. X                      index_point = 0;
  377. X                  if (index_point < first_subj_on_screen
  378. X                  || index_point >= last_subj_on_screen)
  379. X!                     show_group_page(group);
  380. X                  else
  381. X!                     draw_subject_arrow();
  382. X                  break;
  383. X  
  384. X              case 'a':    /* author search forward */
  385. X              case 'A':    /* author search backward */
  386. X                  if (index_point < 0) {
  387. X!                     info_message(txt_no_arts);
  388. X                      break;
  389. X                  }
  390. X  
  391. X--- 296,328 ----
  392. X              case ctrl('U'):        /* page up */
  393. X              case 'b':
  394. X  group_page_up:
  395. X!                 if (! top_base)
  396. X                      break;
  397. X  
  398. X  #ifndef USE_CLEARSCREEN
  399. X                  clear_message ();
  400. X  #endif
  401. X!                 erase_subject_arrow ();
  402. X!                 scroll_lines = (full_page_scroll ? NOTESLINES : NOTESLINES / 2);
  403. X!                 if ((n = index_point % scroll_lines) > 0) {
  404. X!                     index_point = index_point - n;
  405. X!                 } else {
  406. X!                     index_point = ((index_point - scroll_lines) / scroll_lines) * scroll_lines;
  407. X!                 }
  408. X!                 if (index_point < 0) {
  409. X                      index_point = 0;
  410. X+                 }
  411. X                  if (index_point < first_subj_on_screen
  412. X                  || index_point >= last_subj_on_screen)
  413. X!                     show_group_page (group);
  414. X                  else
  415. X!                     draw_subject_arrow ();
  416. X                  break;
  417. X  
  418. X              case 'a':    /* author search forward */
  419. X              case 'A':    /* author search backward */
  420. X                  if (index_point < 0) {
  421. X!                     info_message (txt_no_arts);
  422. X                      break;
  423. X                  }
  424. X  
  425. X***************
  426. X*** 426,432 ****
  427. X                  kill_state = change_rcfile (group, TRUE);
  428. X                  if (kill_state == NO_KILLING && n != sort_art_type) {
  429. X                      make_threads (TRUE);
  430. X!                     find_base ();
  431. X                  }
  432. X                  index_point = find_new_pos (old_top, old_artnum, index_point);
  433. X                  show_group_page (group);
  434. X--- 445,451 ----
  435. X                  kill_state = change_rcfile (group, TRUE);
  436. X                  if (kill_state == NO_KILLING && n != sort_art_type) {
  437. X                      make_threads (TRUE);
  438. X!                     find_base (show_only_unread);
  439. X                  }
  440. X                  index_point = find_new_pos (old_top, old_artnum, index_point);
  441. X                  show_group_page (group);
  442. X***************
  443. X*** 649,654 ****
  444. X--- 668,674 ----
  445. X      int len_from;
  446. X      int len_subj;
  447. X      int respnum;
  448. X+     int unread_top = 0;
  449. X  
  450. X  #ifdef SIGTSTP
  451. X      if (do_sigtstp) {
  452. X***************
  453. X*** 674,684 ****
  454. X      CleartoEOLN ();
  455. X  #endif
  456. X  
  457. X!     if (active[my_group[cur_groupnum]].thread) {
  458. X!         sprintf (buf, "%s (%d %d)", group, top_base, top);
  459. X      } else {
  460. X!         sprintf (buf, "%s (U %d)", group, top);
  461. X      }
  462. X      center_line (0, TRUE, buf);
  463. X  
  464. X      col = (COLS - (int) strlen (txt_type_h_for_help))+1;
  465. X--- 694,712 ----
  466. X      CleartoEOLN ();
  467. X  #endif
  468. X  
  469. X!     if (show_only_unread) {
  470. X!         for (i = 0 ; i < top_base ; i++) {
  471. X!             unread_top += 1 + nresp (i);
  472. X!         }    
  473. X      } else {
  474. X!         unread_top = top;
  475. X      }
  476. X+ 
  477. X+     if (active[my_group[cur_groupnum]].thread && thread_arts) {
  478. X+         sprintf (buf, "%s (%d %d)", group, top_base, unread_top);
  479. X+     } else {
  480. X+         sprintf (buf, "%s (U %d)", group, unread_top);
  481. X+     }
  482. X      center_line (0, TRUE, buf);
  483. X  
  484. X      col = (COLS - (int) strlen (txt_type_h_for_help))+1;
  485. X***************
  486. X*** 703,726 ****
  487. X  
  488. X      MoveCursor (INDEX_TOP, 0);
  489. X  
  490. X      if (NOTESLINES <= 0) {
  491. X          first_subj_on_screen = 0;
  492. X      } else {
  493. X          first_subj_on_screen = (index_point / NOTESLINES) * NOTESLINES;
  494. X!         if (first_subj_on_screen < 0)
  495. X              first_subj_on_screen = 0;
  496. X      }
  497. X  
  498. X      last_subj_on_screen = first_subj_on_screen + NOTESLINES;
  499. X      if (last_subj_on_screen >= top_base) {
  500. X          last_subj_on_screen = top_base;
  501. X!         first_subj_on_screen = top_base - NOTESLINES;
  502. X  
  503. X!         if (first_subj_on_screen < 0)
  504. X!             first_subj_on_screen = 0;
  505. X      }
  506. X  
  507. X!     if (show_author) {
  508. X         len_from = max_from-BLANK_GROUP_COLS;
  509. X      } else {
  510. X          len_subj = (max_subj+max_from+3)-BLANK_GROUP_COLS;
  511. X--- 731,771 ----
  512. X  
  513. X      MoveCursor (INDEX_TOP, 0);
  514. X  
  515. X+     if (index_point >= top_base) {
  516. X+         index_point = top_base - 1;
  517. X+     }
  518. X+ 
  519. X      if (NOTESLINES <= 0) {
  520. X          first_subj_on_screen = 0;
  521. X      } else {
  522. X          first_subj_on_screen = (index_point / NOTESLINES) * NOTESLINES;
  523. X!         if (first_subj_on_screen < 0) {
  524. X              first_subj_on_screen = 0;
  525. X+         }
  526. X      }
  527. X  
  528. X      last_subj_on_screen = first_subj_on_screen + NOTESLINES;
  529. X+ 
  530. X      if (last_subj_on_screen >= top_base) {
  531. X          last_subj_on_screen = top_base;
  532. X!         first_subj_on_screen = (top_base / NOTESLINES) * NOTESLINES;
  533. X  
  534. X!         if (first_subj_on_screen == last_subj_on_screen ||
  535. X!             first_subj_on_screen < 0) {
  536. X!             if (first_subj_on_screen < 0) {
  537. X!                 first_subj_on_screen = 0;
  538. X!             } else {
  539. X!                 first_subj_on_screen = last_subj_on_screen - NOTESLINES;
  540. X!             }
  541. X!         }
  542. X      }
  543. X  
  544. X!     if (top_base == 0) {
  545. X!         first_subj_on_screen = 0;
  546. X!         last_subj_on_screen = 0;
  547. X!     }
  548. X! 
  549. X!     if (show_author != SHOW_FROM_NONE) {
  550. X         len_from = max_from-BLANK_GROUP_COLS;
  551. X      } else {
  552. X          len_subj = (max_subj+max_from+3)-BLANK_GROUP_COLS;
  553. X***************
  554. X*** 748,757 ****
  555. X              strcpy (resps, "   ");
  556. X          }
  557. X  
  558. X!         my_strncpy (from, arts[respnum].from, max_from);
  559. X  
  560. X          if (draw_arrow_mark) {
  561. X!             if (show_author) {
  562. X                  my_strncpy (subject, arts[respnum].subject, max_subj);
  563. X                  printf ("  %4d%3s %s%-*s   %-s\r\n",
  564. X                         i+1, new_resps, resps, max_subj, subject, from);
  565. X--- 793,817 ----
  566. X              strcpy (resps, "   ");
  567. X          }
  568. X  
  569. X!         switch (show_author) {
  570. X!             case SHOW_FROM_ADDR:
  571. X!                 my_strncpy (from, arts[respnum].from, max_from);
  572. X!                 break;
  573. X!             case SHOW_FROM_NAME:
  574. X!                 my_strncpy (from, arts[respnum].name, max_from);
  575. X!                 break;
  576. X!             case SHOW_FROM_BOTH:
  577. X!                 if (arts[respnum].name != (char *) 0) { 
  578. X!                     sprintf (msg, "%s (%s)", arts[respnum].from, arts[respnum].name);
  579. X!                     my_strncpy (from, msg, max_from);
  580. X!                 } else { 
  581. X!                     my_strncpy (from, arts[respnum].from, max_from);
  582. X!                 }
  583. X!                 break;
  584. X!         }
  585. X  
  586. X          if (draw_arrow_mark) {
  587. X!             if (show_author != SHOW_FROM_NONE) {
  588. X                  my_strncpy (subject, arts[respnum].subject, max_subj);
  589. X                  printf ("  %4d%3s %s%-*s   %-s\r\n",
  590. X                         i+1, new_resps, resps, max_subj, subject, from);
  591. X***************
  592. X*** 761,767 ****
  593. X                         i+1, new_resps, resps, subject);
  594. X              }
  595. X          } else {
  596. X!             if (show_author) {
  597. X                  my_strncpy (subject, arts[respnum].subject, max_subj);
  598. X                  sprintf (screen[j].col, "  %4d%3s %s%-*s   %-*s\r\n",
  599. X                         i+1, new_resps, resps, max_subj, subject, len_from, from);
  600. X--- 821,827 ----
  601. X                         i+1, new_resps, resps, subject);
  602. X              }
  603. X          } else {
  604. X!             if (show_author != SHOW_FROM_NONE) {
  605. X                  my_strncpy (subject, arts[respnum].subject, max_subj);
  606. X                  sprintf (screen[j].col, "  %4d%3s %s%-*s   %-*s\r\n",
  607. X                         i+1, new_resps, resps, max_subj, subject, len_from, from);
  608. X***************
  609. X*** 841,849 ****
  610. X      int i;
  611. X      int sum = 0;
  612. X  
  613. X!     for (i = (int) base[thread]; i >= 0; i = arts[i].thread)
  614. X!             if (arts[i].unread)
  615. X!                 sum++;
  616. X      
  617. X      return sum;
  618. X  }
  619. X--- 901,911 ----
  620. X      int i;
  621. X      int sum = 0;
  622. X  
  623. X!     for (i = (int) base[thread]; i >= 0; i = arts[i].thread) {
  624. X!         if (arts[i].unread) {
  625. X!             sum++;
  626. X!         }
  627. X!     }
  628. X      
  629. X      return sum;
  630. X  }
  631. XFiles ../105/hashstr.c and ./hashstr.c are identical
  632. Xdiff -rcs ../105/help.c ./help.c
  633. X*** ../105/help.c    Tue Oct  8 14:56:02 1991
  634. X--- ./help.c    Fri Oct 18 09:41:33 1991
  635. X***************
  636. X*** 3,9 ****
  637. X   *  Module    : help.c
  638. X   *  Author    : R.Skrenta / I.Lea
  639. X   *  Created   : 01-04-91
  640. X!  *  Updated   : 26-09-91
  641. X   *  Release   : 1.0
  642. X   *  Notes     :
  643. X   *  Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
  644. X--- 3,9 ----
  645. X   *  Module    : help.c
  646. X   *  Author    : R.Skrenta / I.Lea
  647. X   *  Created   : 01-04-91
  648. X!  *  Updated   : 18-09-91
  649. X   *  Release   : 1.0
  650. X   *  Notes     :
  651. X   *  Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
  652. X***************
  653. X*** 40,47 ****
  654. X      txt_help_w,
  655. X      txt_help_W,
  656. X      txt_help_g_y,
  657. X-     txt_help_g_z,
  658. X      txt_help_g_dollar,
  659. X      txt_help_g_search,
  660. X      (char *) 0
  661. X  };
  662. X--- 40,47 ----
  663. X      txt_help_w,
  664. X      txt_help_W,
  665. X      txt_help_g_y,
  666. X      txt_help_g_dollar,
  667. X+     txt_help_g_z,
  668. X      txt_help_g_search,
  669. X      (char *) 0
  670. X  };
  671. Xdiff -rcs ../105/kill.c ./kill.c
  672. X*** ../105/kill.c    Thu Oct 10 20:11:20 1991
  673. X--- ./kill.c    Mon Nov  4 11:23:09 1991
  674. X***************
  675. X*** 3,9 ****
  676. X   *  Module    : kill.c
  677. X   *  Author    : I.Lea
  678. X   *  Created   : 01-04-91
  679. X!  *  Updated   : 30-09-91
  680. X   *  Release   : 1.0
  681. X   *  Notes     : kill articles
  682. X   *  Copyright : (c) Copyright 1991 by Iain Lea
  683. X--- 3,9 ----
  684. X   *  Module    : kill.c
  685. X   *  Author    : I.Lea
  686. X   *  Created   : 01-04-91
  687. X!  *  Updated   : 04-11-91
  688. X   *  Release   : 1.0
  689. X   *  Notes     : kill articles
  690. X   *  Copyright : (c) Copyright 1991 by Iain Lea
  691. X***************
  692. X*** 174,180 ****
  693. X      sprintf (kill_group, "%s only", group_name);
  694. X      my_strncpy (text, arts[index].subject, COLS-35);
  695. X      sprintf (kill_subj, txt_kill_subject, text);
  696. X!     my_strncpy (text, arts[index].from, COLS-35);
  697. X      sprintf (kill_from, txt_kill_from, text);
  698. X      text[0] = '\0';
  699. X      
  700. X--- 174,185 ----
  701. X      sprintf (kill_group, "%s only", group_name);
  702. X      my_strncpy (text, arts[index].subject, COLS-35);
  703. X      sprintf (kill_subj, txt_kill_subject, text);
  704. X!     if (arts[index].name != (char *) 0) {
  705. X!         sprintf (msg, "%s (%s)", arts[index].from, arts[index].name);
  706. X!         my_strncpy (text, msg, COLS-35);
  707. X!     } else {
  708. X!         my_strncpy (text, arts[index].from, COLS-35);
  709. X!     }
  710. X      sprintf (kill_from, txt_kill_from, text);
  711. X      text[0] = '\0';
  712. X      
  713. X***************
  714. X*** 243,249 ****
  715. X          MoveCursor (INDEX_TOP+10, (int) strlen (txt_kill_group));
  716. X          str = kill_group;
  717. X          printf ("%s", str);
  718. X!         fflush(stdout);
  719. X          do {
  720. X              MoveCursor (INDEX_TOP+10, (int) strlen (txt_kill_group));
  721. X              if ((ch    = ReadCh()) == ' ') {
  722. X--- 248,254 ----
  723. X          MoveCursor (INDEX_TOP+10, (int) strlen (txt_kill_group));
  724. X          str = kill_group;
  725. X          printf ("%s", str);
  726. X!         fflush (stdout);
  727. X          do {
  728. X              MoveCursor (INDEX_TOP+10, (int) strlen (txt_kill_group));
  729. X              if ((ch    = ReadCh()) == ' ') {
  730. X***************
  731. X*** 317,323 ****
  732. X                      }
  733. X                      if (kill_from_ok) {
  734. X                          killf[kill_num].kill_type |= KILL_FROM;
  735. X!                         killf[kill_num].kill_from = str_dup (arts[index].from);
  736. X                      }
  737. X                      if (killf[kill_num].kill_type) {        
  738. X                          if (kill_every_group) {
  739. X--- 322,333 ----
  740. X                      }
  741. X                      if (kill_from_ok) {
  742. X                          killf[kill_num].kill_type |= KILL_FROM;
  743. X!                         if (arts[index].name != (char *) 0) {
  744. X!                             sprintf (msg, "%s (%s)", arts[index].from, arts[index].name);
  745. X!                         } else {
  746. X!                             strcpy (msg, arts[index].from);
  747. X!                         }
  748. X!                         killf[kill_num].kill_from = str_dup (msg);
  749. X                      }
  750. X                      if (killf[kill_num].kill_type) {        
  751. X                          if (kill_every_group) {
  752. X***************
  753. X*** 401,407 ****
  754. X                      switch (killf[j].kill_type) {
  755. X                          case KILL_SUBJ:
  756. X  #ifdef DONT_USE_REGEX 
  757. X!                             if (str_str (arts[i].subject, killf[j].kill_subj) != 0) {
  758. X  #else        
  759. X                              if (wildmat (arts[i].subject, killf[j].kill_subj)) {
  760. X  #endif        
  761. X--- 411,418 ----
  762. X                      switch (killf[j].kill_type) {
  763. X                          case KILL_SUBJ:
  764. X  #ifdef DONT_USE_REGEX 
  765. X!                             if (str_str (arts[i].subject, killf[j].kill_subj,
  766. X!                                         strlen (killf[j].kill_subj)) != 0) {
  767. X  #else        
  768. X                              if (wildmat (arts[i].subject, killf[j].kill_subj)) {
  769. X  #endif        
  770. X***************
  771. X*** 411,420 ****
  772. X                              }
  773. X                              break;
  774. X                          case KILL_FROM:
  775. X  #ifdef DONT_USE_REGEX 
  776. X!                             if (str_str (arts[i].from, killf[j].kill_from) != 0) {
  777. X  #else        
  778. X!                             if (wildmat (arts[i].from, killf[j].kill_from)) {
  779. X  #endif        
  780. X                                  arts[i].tagged = TRUE;
  781. X                                  killed = TRUE;
  782. X--- 422,437 ----
  783. X                              }
  784. X                              break;
  785. X                          case KILL_FROM:
  786. X+                             if (arts[i].name != (char *) 0) {
  787. X+                                 sprintf (msg, "%s (%s)", arts[i].from, arts[i].name);
  788. X+                             } else {
  789. X+                                 strcpy (msg, arts[i].from);
  790. X+                             }
  791. X  #ifdef DONT_USE_REGEX 
  792. X!                             if (str_str (msg, killf[j].kill_from
  793. X!                                         strlen (killf[j].kill_from)) != 0) {
  794. X  #else        
  795. X!                             if (wildmat (msg, killf[j].kill_from)) {
  796. X  #endif        
  797. X                                  arts[i].tagged = TRUE;
  798. X                                  killed = TRUE;
  799. X***************
  800. X*** 422,428 ****
  801. X                              break;
  802. X                          case KILL_BOTH:
  803. X  #ifdef DONT_USE_REGEX 
  804. X!                             if (str_str (arts[i].subject, killf[j].kill_subj) != 0) {
  805. X  #else        
  806. X                              if (wildmat (arts[i].subject, killf[j].kill_subj)) {
  807. X  #endif        
  808. X--- 439,446 ----
  809. X                              break;
  810. X                          case KILL_BOTH:
  811. X  #ifdef DONT_USE_REGEX 
  812. X!                             if (str_str (arts[i].subject, killf[j].kill_subj,
  813. X!                                         strlen (killf[j].kill_subj)) != 0) {
  814. X  #else        
  815. X                              if (wildmat (arts[i].subject, killf[j].kill_subj)) {
  816. X  #endif        
  817. X***************
  818. X*** 429,438 ****
  819. X                                  arts[i].tagged = TRUE;
  820. X                                  killed = TRUE;
  821. X                              }
  822. X  #ifdef DONT_USE_REGEX 
  823. X!                             if (str_str (arts[i].from, killf[j].kill_from) != 0) {
  824. X  #else        
  825. X!                             if (wildmat (arts[i].from, killf[j].kill_from)) {
  826. X  #endif        
  827. X                                  arts[i].tagged = TRUE;
  828. X                                  killed = TRUE;
  829. X--- 447,462 ----
  830. X                                  arts[i].tagged = TRUE;
  831. X                                  killed = TRUE;
  832. X                              }
  833. X+                             if (arts[i].name != (char *) 0) {
  834. X+                                 sprintf (msg, "%s (%s)", arts[i].from, arts[i].name);
  835. X+                             } else {
  836. X+                                 strcpy (msg, arts[i].from);
  837. X+                             }
  838. X  #ifdef DONT_USE_REGEX 
  839. X!                             if (str_str (msg, killf[j].kill_from,
  840. X!                                         strlen (killf[j].kill_from)) != 0) {
  841. X  #else        
  842. X!                             if (wildmat (msg, killf[j].kill_from)) {
  843. X  #endif        
  844. X                                  arts[i].tagged = TRUE;
  845. X                                  killed = TRUE;
  846. Xdiff -rcs ../105/lang.c ./lang.c
  847. X*** ../105/lang.c    Thu Oct 10 20:27:06 1991
  848. X--- ./lang.c    Thu Oct 31 09:10:16 1991
  849. X***************
  850. X*** 3,9 ****
  851. X   *  Module    : lang.c
  852. X   *  Author    : R.Skrenta / I.Lea
  853. X   *  Created   : 01-04-91
  854. X!  *  Updated   : 10-10-91
  855. X   *  Release   : 1.0
  856. X   *  Notes     :
  857. X   *  Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
  858. X--- 3,9 ----
  859. X   *  Module    : lang.c
  860. X   *  Author    : R.Skrenta / I.Lea
  861. X   *  Created   : 01-04-91
  862. X!  *  Updated   : 31-10-91
  863. X   *  Release   : 1.0
  864. X   *  Notes     :
  865. X   *  Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
  866. X***************
  867. X*** 13,22 ****
  868. X   *              right notice, and it must be included in any copy made
  869. X   */
  870. X  
  871. X- #ifdef LANG_GERMAN
  872. X- 
  873. X- #else
  874. X- 
  875. X  /*
  876. X   *  art.c
  877. X   */
  878. X--- 13,18 ----
  879. X***************
  880. X*** 36,42 ****
  881. X   */
  882. X  
  883. X  char txt_art_thread_regex_tag[] = " a)rticle, t)hread, r)egex pattern, T)agged articles, e)xit: ";
  884. X! char txt_post_procees_type[] = "Process n)one, s)har, u)udecode, U)udecode & zoo, p)atch: ";
  885. X  #ifdef DONT_USE_REGEX 
  886. X  char txt_feed_pattern[] = "Enter pattern [%s]> ";
  887. X  #else
  888. X--- 32,38 ----
  889. X   */
  890. X  
  891. X  char txt_art_thread_regex_tag[] = " a)rticle, t)hread, r)egex pattern, T)agged articles, e)xit: ";
  892. X! char txt_post_procees_type[] = "Process n)one, s)har, u)udecode, U)udecode & zoo: ";
  893. X  #ifdef DONT_USE_REGEX 
  894. X  char txt_feed_pattern[] = "Enter pattern [%s]> ";
  895. X  #else
  896. X***************
  897. X*** 238,244 ****
  898. X  char txt_resp_to_poster[] = "Responses have been directed to the poster. Post anyway? (y/n): ";
  899. X  char txt_resp_redirect[] = "Responses have been directed to the following newsgroups";
  900. X  char txt_continue[] = "Continue? (y/n): ";
  901. X! char txt_writes[] = "%s writes:\n";
  902. X  char txt_save_filename[] = "Save filename [%s]> ";
  903. X  char txt_art_not_saved[] = "-- Article not saved --";
  904. X  char txt_no_filename[] = "No filename";
  905. X--- 234,240 ----
  906. X  char txt_resp_to_poster[] = "Responses have been directed to the poster. Post anyway? (y/n): ";
  907. X  char txt_resp_redirect[] = "Responses have been directed to the following newsgroups";
  908. X  char txt_continue[] = "Continue? (y/n): ";
  909. X! char txt_writes[] = "%s (%s) writes:\n";
  910. X  char txt_save_filename[] = "Save filename [%s]> ";
  911. X  char txt_art_not_saved[] = "-- Article not saved --";
  912. X  char txt_no_filename[] = "No filename";
  913. X***************
  914. X*** 273,298 ****
  915. X   *  rcfile.c
  916. X   */
  917. X   
  918. X! char txt_opt_autosave[] =        "    1. Auto save       : ";
  919. X! char txt_opt_save_separate[] =   "    2. Save separate   : ";
  920. X! char txt_opt_mark_saved_read[] = "    3. Mark saved read : ";
  921. X! char txt_opt_kill_articles[] =   "    4. Kill articles   : ";
  922. X! char txt_opt_show_author[] =     "    5. Show Author     : ";
  923. X! char txt_opt_draw_arrow[] =      "    6. Draw arrow      : ";
  924. X! char txt_opt_print_header[] =    "    7. Print header    : ";
  925. X! char txt_opt_pos_first_unread[] =  "    8. Goto 1st unread : ";
  926. X! char txt_opt_process_type[] = "    9. Process type    : ";
  927. X! char txt_opt_sort_type[] = "    10 Sort article by : ";
  928. X! char txt_opt_savedir[] = "    11 Save directory  : ";
  929. X! char txt_opt_maildir[] = "    12 Mail directory  : ";
  930. X! char txt_opt_printer[] = "    13 Printer         : ";
  931. X  char txt_options_menu[] = "Options Menu";
  932. X  char txt_post_process_none[] = "None";
  933. X  char txt_post_process_sh[] = "Shell archive";
  934. X  char txt_post_process_uudecode[] = "Uudecode";
  935. X  char txt_post_process_uud_lst_zoo[] = "Uudecode & list zoo archive";
  936. X  char txt_post_process_uud_ext_zoo[] = "Uudecode & extract zoo archive";
  937. X- char txt_post_process_patch[] = "Patch";
  938. X  char txt_sort_by_nothing[] = "Nothing";
  939. X  char txt_sort_by_subj_descend[] = "Subject: field (descending)";
  940. X  char txt_sort_by_subj_ascend[] = "Subject: field (ascending)";
  941. X--- 269,301 ----
  942. X   *  rcfile.c
  943. X   */
  944. X   
  945. X! char txt_opt_autosave[] = "1. Auto save       : ";
  946. X! char txt_opt_save_separate[] = "2. Save separate   : ";
  947. X! char txt_opt_mark_saved_read[] = "3. Mark saved read : ";
  948. X! char txt_opt_kill_articles[] = "4. Kill articles   : ";
  949. X! char txt_opt_draw_arrow[] = "5. Draw arrow      : ";
  950. X! char txt_opt_print_header[] = "6. Print header    : ";
  951. X! char txt_opt_pos_first_unread[] = "7. Goto 1st unread : ";
  952. X! char txt_opt_page_scroll[] = "8. Scroll full page: ";
  953. X! char txt_opt_catchup_groups[] = "9. Catchup on quit : ";
  954. X! char txt_opt_thread_arts[] =   "10 Thread articles : ";
  955. X! char txt_opt_show_only_unread[] = "11 Show only unread: ";
  956. X! char txt_opt_show_author[] = "13 Show author     : ";
  957. X! char txt_opt_process_type[] = "14 Process type    : ";
  958. X! char txt_opt_sort_type[] = "15 Sort article by : ";
  959. X! char txt_opt_savedir[] = "16 Save directory  : ";
  960. X! char txt_opt_maildir[] = "17 Mail directory  : ";
  961. X! char txt_opt_printer[] = "18 Printer         : ";
  962. X  char txt_options_menu[] = "Options Menu";
  963. X+ char txt_show_from_none[] = "None";
  964. X+ char txt_show_from_addr[] = "Addr";
  965. X+ char txt_show_from_name[] = "Name";
  966. X+ char txt_show_from_both[] = "Both";
  967. X  char txt_post_process_none[] = "None";
  968. X  char txt_post_process_sh[] = "Shell archive";
  969. X  char txt_post_process_uudecode[] = "Uudecode";
  970. X  char txt_post_process_uud_lst_zoo[] = "Uudecode & list zoo archive";
  971. X  char txt_post_process_uud_ext_zoo[] = "Uudecode & extract zoo archive";
  972. X  char txt_sort_by_nothing[] = "Nothing";
  973. X  char txt_sort_by_subj_descend[] = "Subject: field (descending)";
  974. X  char txt_sort_by_subj_ascend[] = "Subject: field (ascending)";
  975. X***************
  976. X*** 308,313 ****
  977. X--- 311,320 ----
  978. X  char txt_help_draw_arrow[] = "Draw -> or highlighted bar for selection. <SPACE> toggles & <CR> sets.";
  979. X  char txt_help_kill_articles[] = "Kill articles that match entries in kill file. <SPACE> toggles & <CR> sets.";
  980. X  char txt_help_mark_saved_read[] = "Mark saved articles/threads as read. <SPACE> toggles & <CR> sets."; 
  981. X+ char txt_help_page_scroll[] = "Scroll half/full page of groups/articles. <SPACE> toggles & <CR> sets."; 
  982. X+ char txt_help_catchup_groups[] = "Ask to mark groups read when quiting. <SPACE> toggles & <CR> sets."; 
  983. X+ char txt_help_thread_arts[] = "Enable/disable threading of articles in all groups. <SPACE> toggles & <CR> sets."; 
  984. X+ char txt_help_show_only_unread[] = "Show all articles or only unread articles. <SPACE> toggles & <CR> sets."; 
  985. X  char txt_help_post_proc_type[] = "Post process (ie. unshar) saved article/thread. <SPACE> toggles & <CR> sets."; 
  986. X  char txt_help_sort_type[] = "Sort articles by Subject, From or Date fields. <SPACE> toggles & <CR> sets.";
  987. X  char txt_help_savedir[] = "The directory where you want articles/threads saved.";
  988. X***************
  989. X*** 379,384 ****
  990. X   */
  991. X  
  992. X  char txt_resizing_window[] = "resizing window";
  993. X- 
  994. X- #endif
  995. X  
  996. X--- 386,389 ----
  997. Xdiff -rcs ../105/lang.h ./lang.h
  998. X*** ../105/lang.h    Thu Oct 10 20:27:16 1991
  999. X--- ./lang.h    Tue Oct 29 19:54:38 1991
  1000. X***************
  1001. X*** 3,9 ****
  1002. X   *  Module    : lang.h
  1003. X   *  Author    : I.Lea
  1004. X   *  Created   : 01-04-91
  1005. X!  *  Updated   : 10-10-91
  1006. X   *  Release   : 1.0
  1007. X   *  Notes     :
  1008. X   *  Copyright : (c) Copyright 1991 by Iain Lea
  1009. X--- 3,9 ----
  1010. X   *  Module    : lang.h
  1011. X   *  Author    : I.Lea
  1012. X   *  Created   : 01-04-91
  1013. X!  *  Updated   : 29-10-91
  1014. X   *  Release   : 1.0
  1015. X   *  Notes     :
  1016. X   *  Copyright : (c) Copyright 1991 by Iain Lea
  1017. X***************
  1018. X*** 269,282 ****
  1019. X  extern char txt_opt_post_process[];
  1020. X  extern char txt_opt_print_header[];
  1021. X  extern char txt_opt_pos_first_unread[];
  1022. X  extern char txt_opt_process_type[];
  1023. X  extern char txt_opt_sort_type[];
  1024. X  extern char txt_post_process_none[];
  1025. X  extern char txt_post_process_sh[];
  1026. X  extern char txt_post_process_uudecode[];
  1027. X  extern char txt_post_process_uud_lst_zoo[];
  1028. X  extern char txt_post_process_uud_ext_zoo[];
  1029. X- extern char txt_post_process_patch[];
  1030. X  extern char txt_sort_by_nothing[];
  1031. X  extern char txt_sort_by_subj_descend[];
  1032. X  extern char txt_sort_by_subj_ascend[];
  1033. X--- 269,289 ----
  1034. X  extern char txt_opt_post_process[];
  1035. X  extern char txt_opt_print_header[];
  1036. X  extern char txt_opt_pos_first_unread[];
  1037. X+ extern char txt_opt_page_scroll[];
  1038. X+ extern char txt_opt_catchup_groups[];
  1039. X+ extern char txt_opt_thread_arts[];
  1040. X+ extern char txt_opt_show_only_unread[];
  1041. X  extern char txt_opt_process_type[];
  1042. X  extern char txt_opt_sort_type[];
  1043. X+ extern char txt_show_from_none[];
  1044. X+ extern char txt_show_from_addr[];
  1045. X+ extern char txt_show_from_name[];
  1046. X+ extern char txt_show_from_both[];
  1047. X  extern char txt_post_process_none[];
  1048. X  extern char txt_post_process_sh[];
  1049. X  extern char txt_post_process_uudecode[];
  1050. X  extern char txt_post_process_uud_lst_zoo[];
  1051. X  extern char txt_post_process_uud_ext_zoo[];
  1052. X  extern char txt_sort_by_nothing[];
  1053. X  extern char txt_sort_by_subj_descend[];
  1054. X  extern char txt_sort_by_subj_ascend[];
  1055. X***************
  1056. X*** 296,301 ****
  1057. X--- 303,312 ----
  1058. X  extern char txt_help_draw_arrow[];
  1059. X  extern char txt_help_kill_articles[];
  1060. X  extern char txt_help_mark_saved_read[];
  1061. X+ extern char txt_help_page_scroll[];
  1062. X+ extern char txt_help_catchup_groups[];
  1063. X+ extern char txt_help_thread_arts[];
  1064. X+ extern char txt_help_show_only_unread[];
  1065. X  extern char txt_help_post_proc_type[];
  1066. X  extern char txt_help_sort_type[];
  1067. X  extern char txt_help_savedir[];
  1068. Xdiff -rcs ../105/main.c ./main.c
  1069. X*** ../105/main.c    Thu Oct 10 21:00:35 1991
  1070. X--- ./main.c    Mon Nov  4 10:01:13 1991
  1071. X***************
  1072. X*** 3,9 ****
  1073. X   *  Module    : main.c
  1074. X   *  Author    : R.Skrenta / I.Lea
  1075. X   *  Created   : 01-04-91
  1076. X!  *  Updated   : 04-10-91
  1077. X   *  Release   : 1.0
  1078. X   *  Notes     :
  1079. X   *  Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
  1080. X--- 3,9 ----
  1081. X   *  Module    : main.c
  1082. X   *  Author    : R.Skrenta / I.Lea
  1083. X   *  Created   : 01-04-91
  1084. X!  *  Updated   : 04-11-91
  1085. X   *  Release   : 1.0
  1086. X   *  Notes     :
  1087. X   *  Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
  1088. X***************
  1089. X*** 121,130 ****
  1090. X                  break;
  1091. X  
  1092. X              case 'm':
  1093. X-                 my_strncpy (mailer, optarg, LEN);
  1094. X-                 break;
  1095. X- 
  1096. X-             case 'M':
  1097. X                  my_strncpy (maildir, optarg, LEN);
  1098. X                  set_real_uid_gid ();
  1099. X                  if (stat (maildir, &st) == -1) {
  1100. X--- 121,126 ----
  1101. X***************
  1102. X*** 133,138 ****
  1103. X--- 129,140 ----
  1104. X                  set_tin_uid_gid ();
  1105. X                  break;
  1106. X  
  1107. X+             case 'M':    /* mail new news to specified user */
  1108. X+                 my_strncpy (mail_news_user, optarg, LEN);
  1109. X+                 mail_news = TRUE;
  1110. X+                 update = TRUE;
  1111. X+                 break;
  1112. X+ 
  1113. X              case 'n':
  1114. X                  notify_new_groups = TRUE;
  1115. X                  break;
  1116. X***************
  1117. X*** 224,229 ****
  1118. X--- 226,233 ----
  1119. X          read_kill_file ();
  1120. X      }
  1121. X      
  1122. X+     log_user ();
  1123. X+ 
  1124. X      /*
  1125. X       *  check/start if any new/unread articles
  1126. X       */
  1127. X***************
  1128. X*** 239,252 ****
  1129. X      }
  1130. X  
  1131. X      /*
  1132. X       *  save any new articles to savedir structure for later reading
  1133. X       */
  1134. X!     if (save_news) {
  1135. X          i = catchup;            /* set catchup to FALSE */
  1136. X          catchup = FALSE;
  1137. X          do_update ();
  1138. X          catchup = i;            /* set catchup to previous value */
  1139. X!         check_start_save_any_news (SAVE_ANY_NEWS);
  1140. X          exit (0);
  1141. X      }
  1142. X      
  1143. X--- 243,262 ----
  1144. X      }
  1145. X  
  1146. X      /*
  1147. X+      *  mail any new articles to specified user
  1148. X+      *  or
  1149. X       *  save any new articles to savedir structure for later reading
  1150. X       */
  1151. X!     if (mail_news || save_news) {
  1152. X          i = catchup;            /* set catchup to FALSE */
  1153. X          catchup = FALSE;
  1154. X          do_update ();
  1155. X          catchup = i;            /* set catchup to previous value */
  1156. X!         if (mail_news) {
  1157. X!             check_start_save_any_news (MAIL_ANY_NEWS);
  1158. X!         } else {
  1159. X!             check_start_save_any_news (SAVE_ANY_NEWS);
  1160. X!         }
  1161. X          exit (0);
  1162. X      }
  1163. X      
  1164. X***************
  1165. X*** 306,326 ****
  1166. X      sprintf (msg, "%s %s PL%d - threaded usenet newsreader. Copyright 1991 Iain Lea.\n", progname, version, PATCHLEVEL);
  1167. X      error_message (msg, (char *) 0);
  1168. X      error_message ("Usage: %s [options] [newsgroups]", progname);
  1169. X!     error_message ("  -c       mark all articles as read in subscribed newsgroups", (char *) 0);
  1170. X!     error_message ("  -d dir   save articles to directory [default=%s]", savedir);
  1171. X!     error_message ("  -f file  subscribed newsgroups file [default=%s]", newsrc);
  1172. X      error_message ("  -h       help", (char *) 0);
  1173. X!     error_message ("  -m file  mail program [default=%s]", DEFAULT_MAILER);
  1174. X!     error_message ("  -n       notify user of any new newsgroups since last session", (char *) 0);
  1175. X!     error_message ("  -M dir   mailbox directory [default=%s]", maildir);
  1176. X      error_message ("  -p file  print program with options [default=%s]", DEFAULT_PRINTER);
  1177. X      error_message ("  -r       read news remotely from default NNTP server", DEFAULT_PRINTER);
  1178. X      error_message ("  -s dir   spool directory [default=%s]", SPOOLDIR);
  1179. X!     error_message ("  -S       save all new articles for later reading", (char *) 0);
  1180. X!     error_message ("  -u       update index files only", (char *) 0);
  1181. X      error_message ("  -U       fork %s -u to update index files in background", progname);
  1182. X!     error_message ("  -v       update index files only (verbose)", (char *) 0);
  1183. X      error_message ("  -z       start if any unread news", (char *) 0);
  1184. X!     error_message ("  -Z       return status indicating if any unread news", (char *) 0);
  1185. X      error_message ("\nMail bug reports/gripes/comments to %s", BUG_REPORT_ADDRESS);
  1186. X  }
  1187. X--- 316,337 ----
  1188. X      sprintf (msg, "%s %s PL%d - threaded usenet newsreader. Copyright 1991 Iain Lea.\n", progname, version, PATCHLEVEL);
  1189. X      error_message (msg, (char *) 0);
  1190. X      error_message ("Usage: %s [options] [newsgroups]", progname);
  1191. X!     error_message ("  -c       mark all news as read in subscribed newsgroups (batch mode)", (char *) 0);
  1192. X!     error_message ("  -d dir   directory to use when saving news [default=%s]", savedir);
  1193. X!     error_message ("  -f file  subscribed to newsgroups file [default=%s]", newsrc);
  1194. X      error_message ("  -h       help", (char *) 0);
  1195. X!     error_message ("  -m dir   mailbox directory [default=%s]", maildir);
  1196. X!     error_message ("  -M user  mail new news to specified user (batch mode)", (char *) 0);
  1197. X!     error_message ("  -n       notify user if any new newsgroups were created since last session", (char *) 0);
  1198. X      error_message ("  -p file  print program with options [default=%s]", DEFAULT_PRINTER);
  1199. X      error_message ("  -r       read news remotely from default NNTP server", DEFAULT_PRINTER);
  1200. X+     error_message ("  -R       read news saved by -S option for later reading", (char *) 0);
  1201. X      error_message ("  -s dir   spool directory [default=%s]", SPOOLDIR);
  1202. X!     error_message ("  -S       save new news for later reading (batch mode)", (char *) 0);
  1203. X!     error_message ("  -u       update index files only (batch mode)", (char *) 0);
  1204. X      error_message ("  -U       fork %s -u to update index files in background", progname);
  1205. X!     error_message ("  -v       verbose output for -c -M -S -u and -Z options (batch mode)", (char *) 0);
  1206. X      error_message ("  -z       start if any unread news", (char *) 0);
  1207. X!     error_message ("  -Z       return status indicating if any unread news (batch mode)", (char *) 0);
  1208. X      error_message ("\nMail bug reports/gripes/comments to %s", BUG_REPORT_ADDRESS);
  1209. X  }
  1210. Xdiff -rcs ../105/memory.c ./memory.c
  1211. X*** ../105/memory.c    Wed Oct  2 20:20:33 1991
  1212. X--- ./memory.c    Mon Nov  4 18:40:07 1991
  1213. X***************
  1214. X*** 3,9 ****
  1215. X   *  Module    : memory.c
  1216. X   *  Author    : R.Skrenta / I.Lea
  1217. X   *  Created   : 01-04-91
  1218. X!  *  Updated   : 10-09-91
  1219. X   *  Release   : 1.0
  1220. X   *  Notes     :
  1221. X   *  Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
  1222. X--- 3,9 ----
  1223. X   *  Module    : memory.c
  1224. X   *  Author    : R.Skrenta / I.Lea
  1225. X   *  Created   : 01-04-91
  1226. X!  *  Updated   : 04-11-91
  1227. X   *  Release   : 1.0
  1228. X   *  Notes     :
  1229. X   *  Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
  1230. X***************
  1231. X*** 74,80 ****
  1232. X  
  1233. X      for (i=0 ; i < top ; i++) {
  1234. X          arts[i].artnum = 0L;
  1235. X!         arts[i].thread = ART_NORMAL;
  1236. X          arts[i].inthread = FALSE;
  1237. X          arts[i].unread = ART_UNREAD;
  1238. X          arts[i].tagged = FALSE;
  1239. X--- 74,80 ----
  1240. X  
  1241. X      for (i=0 ; i < top ; i++) {
  1242. X          arts[i].artnum = 0L;
  1243. X!         arts[i].thread = ART_EXPIRED;
  1244. X          arts[i].inthread = FALSE;
  1245. X          arts[i].unread = ART_UNREAD;
  1246. X          arts[i].tagged = FALSE;
  1247. X***************
  1248. X*** 262,267 ****
  1249. X--- 262,268 ----
  1250. X      
  1251. X      save_num = 0;
  1252. X  }
  1253. X+ 
  1254. X  
  1255. X  char *my_malloc (size)
  1256. X      unsigned size;
  1257. Xdiff -rcs ../105/misc.c ./misc.c
  1258. X*** ../105/misc.c    Tue Oct 15 09:40:50 1991
  1259. X--- ./misc.c    Mon Nov  4 13:24:43 1991
  1260. X***************
  1261. X*** 3,9 ****
  1262. X   *  Module    : misc.c
  1263. X   *  Author    : R.Skrenta / I.Lea
  1264. X   *  Created   : 01-04-91
  1265. X!  *  Updated   : 15-10-91
  1266. X   *  Release   : 1.0
  1267. X   *  Notes     :
  1268. X   *  Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
  1269. X--- 3,9 ----
  1270. X   *  Module    : misc.c
  1271. X   *  Author    : R.Skrenta / I.Lea
  1272. X   *  Created   : 01-04-91
  1273. X!  *  Updated   : 04-11-91
  1274. X   *  Release   : 1.0
  1275. X   *  Notes     :
  1276. X   *  Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
  1277. X***************
  1278. X*** 45,50 ****
  1279. X--- 45,51 ----
  1280. X  char page_header[LEN];        /* page header of pgm name and version */
  1281. X  char savedir[LEN];            /* directory to save articles to */
  1282. X  char spooldir[LEN];            /* directory where new is */
  1283. X+ char mail_news_user[LEN];    /* mail new news to this user address */
  1284. X  char mailer[LEN];            /* mail program */
  1285. X  char maildir[LEN];            /* mailbox dir where = saves are stored */
  1286. X  char mailbox[LEN];            /* system mailbox for each user */
  1287. X***************
  1288. X*** 52,71 ****
  1289. X  char article[LEN];            /* ~/.article file */
  1290. X  char dead_article[LEN];        /* ~/dead.article file */
  1291. X  char progname[LEN];            /* program name */
  1292. X! int sort_art_type;            /* sort arts[] array by subject,from or date field */
  1293. X! int save_separate;            /* save a each part of a thread to a separate file */
  1294. X! int save_archive_name;        /* save thread with name from Archive-name: field */
  1295. X! int print_header;            /* print all of mail header or just Subject: & From lines */
  1296. X! int pos_first_unread;        /* position cursor at first/last unread article */
  1297. X! int show_author;            /* show Subject & From or only Subject in group menu */
  1298. X  int draw_arrow_mark;        /* draw -> or highlighted bar */
  1299. X  int kill_articles;            /* kill articles matching kill file contents */
  1300. X  int mark_saved_read;        /* mark saved article/thread as read */
  1301. X  int post_proc_type;            /* type of post processing to be performed */
  1302. X! int default_printer;        /* set to false if user give a printer with -p switch */
  1303. X  int save_news;                /* save all arts to savedir structure */
  1304. X  int thread_arts;            /* thread/unthread articles for viewing */
  1305. X! int num_of_tagged_files;
  1306. X  
  1307. X  /*
  1308. X   * init_selfinfo
  1309. X--- 53,77 ----
  1310. X  char article[LEN];            /* ~/.article file */
  1311. X  char dead_article[LEN];        /* ~/dead.article file */
  1312. X  char progname[LEN];            /* program name */
  1313. X! int catchup_read_groups;    /* ask if read groups are to be marked read */
  1314. X! int default_printer;        /* set to false if user give a printer with -p switch */
  1315. X  int draw_arrow_mark;        /* draw -> or highlighted bar */
  1316. X+ int full_page_scroll;        /* page half/full screen of articles/groups */
  1317. X  int kill_articles;            /* kill articles matching kill file contents */
  1318. X  int mark_saved_read;        /* mark saved article/thread as read */
  1319. X+ int num_of_tagged_files;
  1320. X+ int pos_first_unread;        /* position cursor at first/last unread article */
  1321. X  int post_proc_type;            /* type of post processing to be performed */
  1322. X! int print_header;            /* print all of mail header or just Subject: & From lines */
  1323. X! int save_archive_name;        /* save thread with name from Archive-name: field */
  1324. X! int mail_news;                /* mail all arts to specified user */
  1325. X  int save_news;                /* save all arts to savedir structure */
  1326. X+ int save_separate;            /* save a each part of a thread to a separate file */
  1327. X+ int show_author;            /* show Subject & From or only Subject in group menu */
  1328. X+ int show_only_unread;        /* show only new/unread arts or all arts */
  1329. X+ int sort_art_type;            /* sort arts[] array by subject,from or date field */
  1330. X  int thread_arts;            /* thread/unthread articles for viewing */
  1331. X! struct passwd *myentry;
  1332. X  
  1333. X  /*
  1334. X   * init_selfinfo
  1335. X***************
  1336. X*** 82,88 ****
  1337. X      char nam[LEN];
  1338. X      char *p;
  1339. X      FILE *fp;
  1340. X-     struct passwd *myentry;
  1341. X      struct stat sb;
  1342. X  
  1343. X      if ((p = getlogin ()) != (char *) 0) {
  1344. X--- 88,93 ----
  1345. X***************
  1346. X*** 93,104 ****
  1347. X  
  1348. X      strcpy (userid, myentry->pw_name);
  1349. X  
  1350. X!     if ((p = getenv("HOME")) != NULL) {
  1351. X          strcpy (homedir, p);
  1352. X      } else {
  1353. X          strcpy (homedir, myentry->pw_dir);
  1354. X      }
  1355. X  
  1356. X  #ifdef USE_INVERSE_HACK
  1357. X      draw_arrow_mark = TRUE;
  1358. X  #else
  1359. X--- 98,110 ----
  1360. X  
  1361. X      strcpy (userid, myentry->pw_name);
  1362. X  
  1363. X!     if ((p = getenv ("HOME")) != NULL) {
  1364. X          strcpy (homedir, p);
  1365. X      } else {
  1366. X          strcpy (homedir, myentry->pw_dir);
  1367. X      }
  1368. X  
  1369. X+     catchup_read_groups = TRUE;
  1370. X  #ifdef USE_INVERSE_HACK
  1371. X      draw_arrow_mark = TRUE;
  1372. X  #else
  1373. X***************
  1374. X*** 109,114 ****
  1375. X--- 115,121 ----
  1376. X  #else    
  1377. X      default_printer = FALSE;
  1378. X  #endif
  1379. X+     full_page_scroll = TRUE;
  1380. X      kill_articles = FALSE;
  1381. X      mark_saved_read = TRUE;
  1382. X      num_of_tagged_files = 0;
  1383. X***************
  1384. X*** 117,123 ****
  1385. X      print_header = FALSE;
  1386. X      save_separate = TRUE;
  1387. X      save_archive_name = TRUE;
  1388. X!     show_author = TRUE;
  1389. X      sort_art_type = SORT_BY_NOTHING;
  1390. X      save_news = FALSE;
  1391. X      thread_arts = TRUE;
  1392. X--- 124,131 ----
  1393. X      print_header = FALSE;
  1394. X      save_separate = TRUE;
  1395. X      save_archive_name = TRUE;
  1396. X!     show_author = SHOW_FROM_NAME;
  1397. X!     show_only_unread = FALSE;
  1398. X      sort_art_type = SORT_BY_NOTHING;
  1399. X      save_news = FALSE;
  1400. X      thread_arts = TRUE;
  1401. X***************
  1402. X*** 359,365 ****
  1403. X          }
  1404. X      }
  1405. X  
  1406. X!     error_message (txt_cannot_find_base_art, (char *) atoi (n));
  1407. X      return -1;
  1408. X  }
  1409. X  
  1410. X--- 367,374 ----
  1411. X          }
  1412. X      }
  1413. X  
  1414. X!     sprintf (msg, "%d", n);
  1415. X!     error_message (txt_cannot_find_base_art, msg);
  1416. X      return -1;
  1417. X  }
  1418. X  
  1419. X***************
  1420. X*** 503,508 ****
  1421. X--- 512,518 ----
  1422. X      center_line (0, TRUE, msg);
  1423. X      MoveCursor (INDEX_TOP, 0);
  1424. X      
  1425. X+     EndWin ();
  1426. X      Raw (FALSE);
  1427. X  
  1428. X      set_real_uid_gid ();
  1429. X***************
  1430. X*** 522,527 ****
  1431. X--- 532,538 ----
  1432. X      set_tin_uid_gid ();
  1433. X  
  1434. X      Raw (TRUE);
  1435. X+     InitWin ();
  1436. X  
  1437. X      mail_setup ();
  1438. X  
  1439. X***************
  1440. X*** 543,571 ****
  1441. X      /*
  1442. X       * check if any groups were read & ask if they should marked read
  1443. X       */
  1444. X!     for (i = 0 ; i < local_top ; i++) {
  1445. X!         if (active[my_group[i]].read) {
  1446. X!             if (ask) {
  1447. X!                 if (prompt_yn (LINES, "Catchup all groups entered during this session? (y/n): ", 'n')) {
  1448. X!                     ask = FALSE;
  1449. X!                     thread_arts = FALSE;    /* speeds up index loading */
  1450. X!                 } else {
  1451. X!                     break;
  1452. X                  }
  1453. X!             }
  1454. X!             sprintf (msg, "Catchup %s...", active[my_group[i]].name);
  1455. X!             wait_message (msg);
  1456. X!             strcpy (group_path, active[my_group[i]].name);
  1457. X!             for (p = group_path; *p; p++) {
  1458. X!                 if (*p == '.') {
  1459. X!                     *p = '/';
  1460. X                  }
  1461. X              }
  1462. X-             index_group (active[my_group[i]].name, group_path);
  1463. X-             for (j = 0; j < top; j++) {
  1464. X-                 arts[j].unread = ART_READ;
  1465. X-             }
  1466. X-             update_newsrc (active[my_group[i]].name, my_group[i], FALSE);
  1467. X          }
  1468. X      }
  1469. X      nntp_finish ();            /* disconnect from NNTP server */
  1470. X--- 554,584 ----
  1471. X      /*
  1472. X       * check if any groups were read & ask if they should marked read
  1473. X       */
  1474. X!     if (catchup_read_groups) {
  1475. X!         for (i = 0 ; i < local_top ; i++) {
  1476. X!             if (active[my_group[i]].read) {
  1477. X!                 if (ask) {
  1478. X!                     if (prompt_yn (LINES, "Catchup all groups entered during this session? (y/n): ", 'n')) {
  1479. X!                         ask = FALSE;
  1480. X!                         thread_arts = FALSE;    /* speeds up index loading */
  1481. X!                     } else {
  1482. X!                         break;
  1483. X!                     }
  1484. X                  }
  1485. X!                 sprintf (msg, "Catchup %s...", active[my_group[i]].name);
  1486. X!                 wait_message (msg);
  1487. X!                 strcpy (group_path, active[my_group[i]].name);
  1488. X!                 for (p = group_path; *p; p++) {
  1489. X!                     if (*p == '.') {
  1490. X!                         *p = '/';
  1491. X!                     }
  1492. X                  }
  1493. X+                 index_group (active[my_group[i]].name, group_path);
  1494. X+                 for (j = 0; j < top; j++) {
  1495. X+                     arts[j].unread = ART_READ;
  1496. X+                 }
  1497. X+                 update_newsrc (active[my_group[i]].name, my_group[i], FALSE);
  1498. X              }
  1499. X          }
  1500. X      }
  1501. X      nntp_finish ();            /* disconnect from NNTP server */
  1502. X***************
  1503. X*** 844,849 ****
  1504. X--- 857,863 ----
  1505. X      void (*susp)();
  1506. X  #endif
  1507. X  
  1508. X+     EndWin ();
  1509. X      Raw (FALSE);
  1510. X      set_real_uid_gid ();
  1511. X  
  1512. X***************
  1513. X*** 860,866 ****
  1514. X--- 874,882 ----
  1515. X  #endif
  1516. X  
  1517. X      set_tin_uid_gid ();
  1518. X+ 
  1519. X      Raw (TRUE);
  1520. X+     InitWin ();
  1521. X  
  1522. X      return ret == 0;
  1523. X  }
  1524. X***************
  1525. X*** 894,904 ****
  1526. X  void set_real_uid_gid ()
  1527. X  {
  1528. X  #if defined(BSD) && ! defined(SINIX)
  1529. X!     if (seteuid (real_uid) == -1) {
  1530. X!         error_message ("Error seteuid(real) failed", (char *) 0);
  1531. X      }
  1532. X!     if (setegid (real_gid) == -1) {
  1533. X!         error_message ("Error setegid(real) failed", (char *) 0);
  1534. X      }
  1535. X  #else
  1536. X      if (setuid (real_uid) == -1) {
  1537. X--- 910,920 ----
  1538. X  void set_real_uid_gid ()
  1539. X  {
  1540. X  #if defined(BSD) && ! defined(SINIX)
  1541. X!     if (setreuid (tin_uid, real_uid) == -1) {
  1542. X!         error_message ("Error setreuid(real) failed", (char *) 0);
  1543. X      }
  1544. X!     if (setregid (tin_gid, real_gid) == -1) {
  1545. X!         error_message ("Error setregid(real) failed", (char *) 0);
  1546. X      }
  1547. X  #else
  1548. X      if (setuid (real_uid) == -1) {
  1549. X***************
  1550. X*** 914,924 ****
  1551. X  void set_tin_uid_gid ()
  1552. X  {
  1553. X  #if defined(BSD) && ! defined(SINIX)
  1554. X!     if (seteuid (tin_uid) == -1) {
  1555. X!         error_message ("Error seteuid(tin) failed", (char *) 0);
  1556. X      }
  1557. X!     if (setegid (tin_gid) == -1) {
  1558. X!         error_message ("Error setegid(tin) failed", (char *) 0);
  1559. X      }
  1560. X  #else
  1561. X      if (setuid (tin_uid) == -1) {
  1562. X--- 930,940 ----
  1563. X  void set_tin_uid_gid ()
  1564. X  {
  1565. X  #if defined(BSD) && ! defined(SINIX)
  1566. X!     if (setreuid (real_uid, tin_uid) == -1) {
  1567. X!         error_message ("Error setreuid(tin) failed", (char *) 0);
  1568. X      }
  1569. X!     if (setregid (real_gid, tin_gid) == -1) {
  1570. X!         error_message ("Error setregid(tin) failed", (char *) 0);
  1571. X      }
  1572. X  #else
  1573. X      if (setuid (tin_uid) == -1) {
  1574. X***************
  1575. X*** 1069,1071 ****
  1576. X--- 1085,1260 ----
  1577. X  
  1578. X      return FALSE;
  1579. X  }
  1580. X+ 
  1581. X+ /*
  1582. X+  *  Parse various From: lines into the component mail addresses and
  1583. X+  *  real names
  1584. X+  */
  1585. X+ 
  1586. X+ void parse_from (str, addr, name)
  1587. X+     char *str;
  1588. X+     char *addr;
  1589. X+     char *name;
  1590. X+ {
  1591. X+     register c;
  1592. X+     register char *cp, *ncp;
  1593. X+     int gotlt, lastsp, level;
  1594. X+ 
  1595. X+     gotlt = 0;
  1596. X+     lastsp = 0;
  1597. X+     cp = addr;
  1598. X+     ncp = name;
  1599. X+     while (*str == ' ')
  1600. X+         ++str;
  1601. X+     while (c = *str++)
  1602. X+         switch (c) {
  1603. X+         case '(':
  1604. X+             ncp = name;
  1605. X+             level = 1;
  1606. X+             while (*str != '\0' && level) {
  1607. X+                 switch (c = *str++) {
  1608. X+                 case '(':
  1609. X+                     *ncp++ = c;
  1610. X+                     level++;
  1611. X+                     break;
  1612. X+                 case ')':
  1613. X+                     level--;
  1614. X+                     if (level > 0)
  1615. X+                         *ncp++ = c;
  1616. X+                     break;
  1617. X+                 default:
  1618. X+                     *ncp++ = c;
  1619. X+                     break;
  1620. X+                 }
  1621. X+             }
  1622. X+             if (*str)
  1623. X+                 str++;
  1624. X+             lastsp = 0;
  1625. X+             break;
  1626. X+         case ' ':
  1627. X+             if (str[0] == 'a' && str[1] == 't' && str[2] == ' ')
  1628. X+                 str += 3, *cp++ = '@';
  1629. X+             else if (str[0] == '@' && str[1] == ' ')
  1630. X+                 str += 2, *cp++ = '@';
  1631. X+             else
  1632. X+                 lastsp = 1;
  1633. X+             if (ncp > name)
  1634. X+                 *ncp++ = ' ';
  1635. X+             break;
  1636. X+         case '<':
  1637. X+             cp = addr;
  1638. X+             gotlt++;
  1639. X+             lastsp = 0;
  1640. X+             break;
  1641. X+         case '>':
  1642. X+             if (gotlt)
  1643. X+                 goto done;
  1644. X+             /* FALL THROUGH CASE */
  1645. X+         default:
  1646. X+             if (lastsp) {
  1647. X+                 lastsp = 0;
  1648. X+                 *cp++ = ' ';
  1649. X+             }
  1650. X+             *cp++ = c;
  1651. X+             if (! gotlt)
  1652. X+                 *ncp++ = c;
  1653. X+             break;
  1654. X+         }
  1655. X+ done:
  1656. X+     *cp = 0;
  1657. X+     while (ncp>name && ncp[-1]==' ')
  1658. X+         --ncp;
  1659. X+     *ncp = 0;
  1660. X+     if (*addr == '@') {
  1661. X+         char buf [512];
  1662. X+ 
  1663. X+         strcpy (buf, addr);
  1664. X+         strcpy (addr, "root");
  1665. X+         strcat (addr, buf);
  1666. X+     }
  1667. X+ }
  1668. X+ 
  1669. X+ /*
  1670. X+  *  Convert a string to a long, only look at first n characters
  1671. X+  */
  1672. X+ 
  1673. X+ long my_atol (s, n)
  1674. X+     char *s;
  1675. X+     int n;
  1676. X+ {
  1677. X+     long ret = 0;
  1678. X+ 
  1679. X+     while (*s && n--) {
  1680. X+         if (*s >= '0' && *s <= '9')
  1681. X+             ret = ret * 10 + (*s - '0');
  1682. X+         else
  1683. X+             return -1;
  1684. X+         s++;
  1685. X+     }
  1686. X+ 
  1687. X+     return ret;
  1688. X+ }
  1689. X+ 
  1690. X+ /*
  1691. X+  *  Return a pointer into s eliminating any leading Re:'s.  Example:
  1692. X+  *
  1693. X+  *      Re: Reorganization of misc.jobs
  1694. X+  *      ^   ^
  1695. X+  */
  1696. X+ 
  1697. X+ char *eat_re (s)
  1698. X+     char *s;
  1699. X+ {
  1700. X+ 
  1701. X+     while (*s == 'r' || *s == 'R') {
  1702. X+         if ((*(s+1) == 'e' || *(s+1) == 'E')) {
  1703. X+             if (*(s+2) == ':')
  1704. X+                 s += 3;
  1705. X+             else if (*(s+2) == '^' && isdigit(*(s+3)) && *(s+4) == ':')
  1706. X+                 s += 5;            /* hurray nn */
  1707. X+             else
  1708. X+                 break;
  1709. X+         } else
  1710. X+             break;
  1711. X+         while (*s == ' ')
  1712. X+             s++;
  1713. X+     }
  1714. X+ 
  1715. X+     return s;
  1716. X+ }
  1717. X+ 
  1718. X+ /*
  1719. X+  *  Hash the subjects (after eating the Re's off) for a quicker
  1720. X+  *  thread search later.  We store the hashes for subjects in the
  1721. X+  *  index file for speed.
  1722. X+  */
  1723. X+ 
  1724. X+ long hash_s (s)
  1725. X+     char *s;
  1726. X+ {
  1727. X+     long h = 0;
  1728. X+     unsigned char *t = (unsigned char *) s;
  1729. X+ 
  1730. X+     while (*t)
  1731. X+         h = h * 64 + *t++;
  1732. X+ 
  1733. X+     return h;
  1734. X+ }
  1735. X+ 
  1736. X+ /*
  1737. X+  *  strncpy that stops at a newline and null terminates
  1738. X+  */
  1739. X+ 
  1740. X+ void my_strncpy(p, q, n)
  1741. X+     char *p;
  1742. X+     char *q;
  1743. X+     int n;
  1744. X+ {
  1745. X+     while (n--) {
  1746. X+         if (! *q || *q == '\n')
  1747. X+             break;
  1748. X+         *p++ = *q++;
  1749. X+     }
  1750. X+     *p = '\0';
  1751. X+ }
  1752. X+ 
  1753. Xdiff -rcs ../105/newsrc.c ./newsrc.c
  1754. X*** ../105/newsrc.c    Wed Oct  2 20:20:33 1991
  1755. X--- ./newsrc.c    Fri Oct 25 19:47:48 1991
  1756. X***************
  1757. X*** 3,9 ****
  1758. X   *  Module    : newsrc.c
  1759. X   *  Author    : R.Skrenta / I.Lea
  1760. X   *  Created   : 01-04-91
  1761. X!  *  Updated   : 30-09-91
  1762. X   *  Release   : 1.0
  1763. X   *  Notes     :
  1764. X   *  Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
  1765. X--- 3,9 ----
  1766. X   *  Module    : newsrc.c
  1767. X   *  Author    : R.Skrenta / I.Lea
  1768. X   *  Created   : 01-04-91
  1769. X!  *  Updated   : 25-10-91
  1770. X   *  Release   : 1.0
  1771. X   *  Notes     :
  1772. X   *  Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
  1773. X***************
  1774. X*** 267,273 ****
  1775. X              if (c != '\0')
  1776. X                  *p++ = '\0';
  1777. X  
  1778. X!             if (c != '!')
  1779. X                  c = ':';
  1780. X  
  1781. X              if (strcmp (buf, group) == 0) {
  1782. X--- 267,273 ----
  1783. X              if (c != '\0')
  1784. X                  *p++ = '\0';
  1785. X  
  1786. X!             if (c != '!' && c != ' ')
  1787. X                  c = ':';
  1788. X  
  1789. X              if (strcmp (buf, group) == 0) {
  1790. XFiles ../105/nntp.h and ./nntp.h are identical
  1791. Xdiff -rcs ../105/open.c ./open.c
  1792. X*** ../105/open.c    Tue Oct  8 20:14:41 1991
  1793. X--- ./open.c    Mon Nov  4 11:26:55 1991
  1794. X***************
  1795. X*** 3,9 ****
  1796. X   *  Module    : open.c
  1797. X   *  Author    : R.Skrenta / I.Lea
  1798. X   *  Created   : 01-04-91
  1799. X!  *  Updated   : 02-10-91
  1800. X   *  Release   : 1.0
  1801. X   *  Notes     : reads news locally (/usr/spool/news) or via NNTP
  1802. X   *  Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
  1803. X--- 3,9 ----
  1804. X   *  Module    : open.c
  1805. X   *  Author    : R.Skrenta / I.Lea
  1806. X   *  Created   : 01-04-91
  1807. X!  *  Updated   : 25-10-91
  1808. X   *  Release   : 1.0
  1809. SHAR_EOF
  1810. echo "End of tin part 2"
  1811. echo "File tin.patch06 is continued in part 3"
  1812. echo "3" > shar3_seq_.tmp
  1813. exit 0
  1814.  
  1815. -- 
  1816.  Dr. med. dipl.-math Dieter Becker           Tel.: (0 / +49) 6841 - 16 3046
  1817.  Medizinische Universitaets- und Poliklinik  Fax.: (0 / +49) 6841 - 16 3369
  1818.  Innere Medizin III                         
  1819.  D - 6650 Homburg / Saar                     Email: becker@med-in.uni-sb.de
  1820. exit 0 # Just in case...
  1821. -- 
  1822. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1823. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1824. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1825. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1826.