home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / alt / sources / 2518 < prev    next >
Encoding:
Internet Message Format  |  1992-11-15  |  60.7 KB

  1. Path: sparky!uunet!ferkel.ucsb.edu!taco!rock!concert!rutgers!jvnc.net!darwin.sura.net!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!doc.ic.ac.uk!uknet!mcsun!Germany.EU.net!anl433!Iain.Lea
  2. From: Iain.Lea%anl433.uucp@Germany.EU.net (Iain Lea)
  3. Newsgroups: alt.sources
  4. Subject: TIN newsreader v1.1 PL7 (Patch 06/10)
  5. Message-ID: <1992Nov15.155230.20284@anl433.uucp>
  6. Date: 15 Nov 92 15:52:30 GMT
  7. Sender: news@anl433.uucp (Netnews Administrator)
  8. Reply-To: Iain.Lea%anl433.uucp@Germany.EU.net
  9. Followup-To: alt.sources.d
  10. Organization: ANL A433, Siemens AG., Germany.
  11. Lines: 2294
  12. X-Newsreader: TIN [version 1.1 PL7]
  13.  
  14. Submitted-by: Iain.Lea%anl433.uucp@Germany.EU.net (Iain Lea)
  15. Archive-name: tin-1.17/part06
  16.  
  17. #!/bin/sh
  18. # this is tin.shar.06 (part 6 of tin-1.17)
  19. # do not concatenate these parts, unpack them in order with /bin/sh
  20. # file tin-1.17.patch continued
  21. #
  22. if test ! -r _shar_seq_.tmp; then
  23.     echo 'Please unpack part 1 first!'
  24.     exit 1
  25. fi
  26. (read Scheck
  27.  if test "$Scheck" != 6; then
  28.     echo Please unpack part "$Scheck" next!
  29.     exit 1
  30.  else
  31.     exit 0
  32.  fi
  33. ) < _shar_seq_.tmp || exit 1
  34. if test ! -f _shar_wnt_.tmp; then
  35.     echo 'x - still skipping tin-1.17.patch'
  36. else
  37. echo 'x - continuing file tin-1.17.patch'
  38. sed 's/^X//' << 'SHAR_EOF' >> 'tin-1.17.patch' &&
  39. X          
  40. X--- 423,435 ----
  41. X  }
  42. X  
  43. X  
  44. X! FILE *open_header_fp (art)
  45. X      long art;
  46. X  {
  47. X      char buf[NNTP_STRLEN];
  48. X! 
  49. X!     if (read_news_via_nntp &&
  50. X!         active[my_group[cur_groupnum]].type == GROUP_TYPE_NEWS) {
  51. X  #ifdef NNTP_ABLE    
  52. X          sprintf(buf, "head %ld", art);
  53. X          
  54. X***************
  55. X*** 356,363 ****
  56. X          return (FILE *) 0;
  57. X  #endif        
  58. X      } else {
  59. X!         joinpath (buf, spooldir, group_path);
  60. X!         sprintf (&buf[strlen(buf)], "/%ld", art);
  61. X          return fopen (buf, "r");
  62. X      }
  63. X  }
  64. X--- 448,454 ----
  65. X          return (FILE *) 0;
  66. X  #endif        
  67. X      } else {
  68. X!         sprintf (buf, "%ld", art);
  69. X          return fopen (buf, "r");
  70. X      }
  71. X  }
  72. X***************
  73. X*** 396,407 ****
  74. X  #endif
  75. X      DIR *d;
  76. X      DIR_BUF *e;
  77. X      long art, start, last, dummy, count;
  78. X  
  79. X      top_base = 0;
  80. X! 
  81. X!     if (read_news_via_nntp) {
  82. X  
  83. X  #ifdef NNTP_ABLE
  84. X          sprintf (buf, "group %s", group);
  85. X  
  86. X--- 487,500 ----
  87. X  #endif
  88. X      DIR *d;
  89. X      DIR_BUF *e;
  90. X+     int i;
  91. X      long art, start, last, dummy, count;
  92. X  
  93. X      top_base = 0;
  94. X!         
  95. X!     i = my_group[cur_groupnum];
  96. X  
  97. X+     if (read_news_via_nntp && active[i].type == GROUP_TYPE_NEWS) {
  98. X  #ifdef NNTP_ABLE
  99. X          sprintf (buf, "group %s", group);
  100. X  
  101. X***************
  102. X*** 436,442 ****
  103. X          return; 
  104. X  #endif
  105. X      } else {
  106. X!         joinpath (buf, spooldir, group_path);
  107. X  
  108. X          if (access (buf, 4) != 0) {
  109. X              return;
  110. X--- 529,535 ----
  111. X          return; 
  112. X  #endif
  113. X      } else {
  114. X!         joinpath (buf, active[i].spooldir, group_path);
  115. X  
  116. X          if (access (buf, 4) != 0) {
  117. X              return;
  118. X***************
  119. X*** 558,566 ****
  120. X  
  121. X  void log_user ()
  122. X  {
  123. X      char buf[32], *ptr;
  124. X      char line[NNTP_STRLEN];
  125. X! #ifdef LOG_USER
  126. X      FILE *fp;
  127. X      long epoch;
  128. X  #endif
  129. X--- 651,660 ----
  130. X  
  131. X  void log_user ()
  132. X  {
  133. X+     char log_file[PATH_LEN];
  134. X      char buf[32], *ptr;
  135. X      char line[NNTP_STRLEN];
  136. X! #ifndef DONT_LOG_USER
  137. X      FILE *fp;
  138. X      long epoch;
  139. X  #endif
  140. X***************
  141. X*** 580,587 ****
  142. X      } else
  143. X  #endif    /* AMIGA */
  144. X      {
  145. X! #ifdef LOG_USER
  146. X!         if ((fp = fopen (LOG_USER_FILE, "a+")) != (FILE *) 0) {
  147. X              time (&epoch);
  148. X              fprintf (fp, "%s%d: %-32s (%-8s) %s", 
  149. X                  VERSION, PATCHLEVEL, buf, 
  150. X--- 674,683 ----
  151. X      } else
  152. X  #endif    /* AMIGA */
  153. X      {
  154. X! #ifndef DONT_LOG_USER
  155. X!         joinpath (log_file, TMPDIR, LOG_USER_FILE);
  156. X!         
  157. X!         if ((fp = fopen (log_file, "a+")) != (FILE *) 0) {
  158. X              time (&epoch);
  159. X              fprintf (fp, "%s%d: %-32s (%-8s) %s", 
  160. X                  VERSION, PATCHLEVEL, buf, 
  161. X***************
  162. X*** 592,604 ****
  163. X  #endif
  164. X                  ctime (&epoch));
  165. X              fclose (fp);
  166. X!             chmod (LOG_USER_FILE, 0666);
  167. X          }    
  168. X! #endif
  169. X      }
  170. X  }
  171. X  
  172. X  /*
  173. X   * NNTP strings for get_respcode()
  174. X   */
  175. X  
  176. X--- 688,784 ----
  177. X  #endif
  178. X                  ctime (&epoch));
  179. X              fclose (fp);
  180. X!             chmod (log_file, 0666);
  181. X          }    
  182. X! #endif    /* DONT_LOG_USER */
  183. X      }
  184. X  }
  185. X  
  186. X  /*
  187. X+  * NNTP user authorization. Password read from ~/.newsauth
  188. X+  * The ~/.newsauth authorization file has the format:  
  189. X+  *   nntpserver1 password
  190. X+  *   nntpserver2 password
  191. X+  *   etc.
  192. X+  */
  193. X+  
  194. X+ void authorization (server, authuser)
  195. X+     char *server;
  196. X+     char *authuser;
  197. X+ {
  198. X+     char authfile[PATH_LEN];
  199. X+     char authpass[PATH_LEN];
  200. X+     char line[NNTP_STRLEN];
  201. X+     char buf[PATH_LEN], *ptr;
  202. X+     int found = FALSE;
  203. X+     FILE *fp;
  204. X+ 
  205. X+     /*
  206. X+      * Check if running via NNTP
  207. X+      */
  208. X+     if (! read_news_via_nntp) {
  209. X+         return;
  210. X+     }
  211. X+ 
  212. X+     /*
  213. X+      * Lets check if the NNTP supports authorization
  214. X+      */
  215. X+     debug_nntp ("authorization", "authinfo");
  216. X+     put_server ("authinfo");
  217. X+     if (get_respcode () == ERR_COMMAND) {
  218. X+         return;
  219. X+     }
  220. X+ 
  221. X+     joinpath (authfile, homedir, ".newsauth");
  222. X+ 
  223. X+     if ((fp = fopen (authfile,"r")) != (FILE *) 0) {
  224. X+         /*
  225. X+          * Search through authorization file for correct NNTP server
  226. X+          * File has format:  'nntp-server' 'password'
  227. X+          */
  228. X+         while (fgets (buf, sizeof (buf), fp) != (char *) 0) {
  229. X+             /*
  230. X+              * Get server from 1st part of the line
  231. X+              */
  232. X+             strcpy (line, buf); 
  233. X+             ptr = (char *) strchr (line, ' ');
  234. X+             if (*ptr) {
  235. X+                 *ptr = '\0';
  236. X+             }
  237. X+ 
  238. X+             if (strncmp (line, server, sizeof (server)) == 0) {
  239. X+                 /*
  240. X+                  * Get passwdord from 2nd part of the line
  241. X+                  */
  242. X+                 ptr = (char *) strrchr (buf, ' ');
  243. X+                 if (*ptr && ++ptr != (char *) 0) {
  244. X+                     strcpy (authpass, ptr); 
  245. X+                     ptr = (char *) strchr (authpass, '\n');
  246. X+                     if (*ptr) {
  247. X+                         *ptr = '\0';
  248. X+                     }
  249. X+                     found = TRUE;
  250. X+                 }
  251. X+                 break;
  252. X+             }
  253. X+         }
  254. X+         fclose (fp); 
  255. X+ 
  256. X+         if (! found) {
  257. X+             error_message (txt_nntp_authorization_failed, authuser);
  258. X+         } else {
  259. X+             sprintf (line, "authinfo user %s", authuser);
  260. X+             put_server (line);
  261. X+             get_respcode ();
  262. X+ 
  263. X+             sprintf (line, "authinfo pass %s", authpass);
  264. X+             put_server (line);
  265. X+             get_respcode ();
  266. X+         }
  267. X+     }
  268. X+ }
  269. X+ 
  270. X+ /*
  271. X   * NNTP strings for get_respcode()
  272. X   */
  273. X  
  274. X***************
  275. X*** 640,645 ****
  276. X--- 820,828 ----
  277. X          case OK_GROUPS:
  278. X              text = "215  Newsgroups follow";
  279. X              break;
  280. X+         case OK_XMOTD:
  281. X+             text = "217  News motd file follows";
  282. X+             break;
  283. X          case OK_XINDEX:
  284. X              text = "218  Group index file follows";
  285. X              break;
  286. X***************
  287. X*** 715,720 ****
  288. X--- 898,906 ----
  289. X          case ERR_NCING:
  290. X              text = "412  Not currently in newsgroup";
  291. X              break;
  292. X+         case ERR_XMOTD:
  293. X+             text = "417  No news motd file";
  294. X+             break;
  295. X          case ERR_XINDEX:
  296. X              text = "418  No index file for this group";
  297. X              break;
  298. X***************
  299. X*** 787,789 ****
  300. X--- 973,976 ----
  301. X      return ("");
  302. X  #endif
  303. X  }
  304. X+ 
  305. Xdiff -rcs ../1.16/page.c ./page.c
  306. X*** ../1.16/page.c    Sun Nov 15 18:42:00 1992
  307. X--- ./page.c    Sun Nov 15 16:02:48 1992
  308. X***************
  309. X*** 3,9 ****
  310. X   *  Module    : page.c
  311. X   *  Author    : I.Lea & R.Skrenta
  312. X   *  Created   : 01-04-91
  313. X!  *  Updated   : 31-08-92
  314. X   *  Notes     :
  315. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  316. X   *              You may  freely  copy or  redistribute  this software,
  317. X--- 3,9 ----
  318. X   *  Module    : page.c
  319. X   *  Author    : I.Lea & R.Skrenta
  320. X   *  Created   : 01-04-91
  321. X!  *  Updated   : 08-11-92
  322. X   *  Notes     :
  323. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  324. X   *              You may  freely  copy or  redistribute  this software,
  325. X***************
  326. X*** 15,26 ****
  327. X  #include    "tin.h"
  328. X  
  329. X  char note_h_path[LEN];            /* Path:    */
  330. X! char note_h_date[LEN];            /* Date:    */
  331. X  char note_h_subj[LEN];            /* Subject:    */
  332. X! char note_h_org[LEN];            /* Organization: */
  333. X  char note_h_newsgroups[LEN];        /* Newsgroups:    */
  334. X! char note_h_messageid[LEN];        /* Message-ID:    */
  335. X! char note_h_distrib[LEN];        /* Distribution: */
  336. X  char note_h_followup[LEN];        /* Followup-To: */
  337. X  
  338. X  char *glob_page_group;
  339. X--- 15,26 ----
  340. X  #include    "tin.h"
  341. X  
  342. X  char note_h_path[LEN];            /* Path:    */
  343. X! char note_h_date[PATH_LEN];        /* Date:    */
  344. X  char note_h_subj[LEN];            /* Subject:    */
  345. X! char note_h_org[PATH_LEN];        /* Organization: */
  346. X  char note_h_newsgroups[LEN];        /* Newsgroups:    */
  347. X! char note_h_messageid[PATH_LEN];    /* Message-ID:    */
  348. X! char note_h_distrib[PATH_LEN];        /* Distribution: */
  349. X  char note_h_followup[LEN];        /* Followup-To: */
  350. X  
  351. X  char *glob_page_group;
  352. X***************
  353. X*** 84,92 ****
  354. X      arts[respnum].unread = ART_READ;    /* mark article as read */
  355. X      
  356. X      if ((note_page = art_open (art, group_path)) == ART_UNAVAILABLE) {
  357. X          sprintf (msg, txt_art_unavailable, art);
  358. X          error_message (msg, "");
  359. X!         return (which_thread (respnum));
  360. X      } else {
  361. X          show_note_page (respnum, group);
  362. X      }
  363. X--- 84,93 ----
  364. X      arts[respnum].unread = ART_READ;    /* mark article as read */
  365. X      
  366. X      if ((note_page = art_open (art, group_path)) == ART_UNAVAILABLE) {
  367. X+         arts[respnum].thread = ART_EXPIRED;
  368. X          sprintf (msg, txt_art_unavailable, art);
  369. X          error_message (msg, "");
  370. X!         return (-5);    /* special retcode to stop redrawing screen */
  371. X      } else {
  372. X          show_note_page (respnum, group);
  373. X      }
  374. X***************
  375. X*** 95,104 ****
  376. X          ch = ReadCh ();
  377. X  
  378. X          if (ch >= '0' && ch <= '9') {
  379. X!             n = prompt_response (ch, respnum);
  380. X!             if (n != -1) {
  381. X!                 respnum = n;
  382. X!                 goto restart;
  383. X              }
  384. X              continue;
  385. X          }
  386. X--- 96,110 ----
  387. X          ch = ReadCh ();
  388. X  
  389. X          if (ch >= '0' && ch <= '9') {
  390. X!             n = which_thread (respnum);
  391. X!             if (! num_of_responses (n)) {
  392. X!                 info_message (txt_no_responses);
  393. X!             } else {
  394. X!                 n = prompt_response (ch, respnum);
  395. X!                 if (n != -1) {
  396. X!                     respnum = n;
  397. X!                     goto restart;
  398. X!                 }
  399. X              }
  400. X              continue;
  401. X          }
  402. X***************
  403. X*** 349,370 ****
  404. X                  redraw_page (respnum, group);
  405. X                  break;
  406. X                  
  407. X!             case 'c':    /* catchup--mark all articles as read */
  408. X                  if (!confirm_action || prompt_yn (LINES, txt_mark_all_read, 'y')) {
  409. X                      for (n = 0; n < top; n++) {
  410. X                          arts[n].unread = ART_READ;
  411. X                      }
  412. X                      fix_new_highest (cur_groupnum);
  413. X                      if (cur_groupnum + 1 < group_top) {
  414. X                          cur_groupnum++;
  415. X                      }
  416. X                      art_close ();
  417. X!                     return -1;
  418. X                  }
  419. X                  break;
  420. X  
  421. X!             case 'C':    /* cancel an article */
  422. X!                 if (cancel_article (group, respnum)) {
  423. X                      redraw_page (respnum, group);
  424. X                  }
  425. X                  break;
  426. X--- 355,381 ----
  427. X                  redraw_page (respnum, group);
  428. X                  break;
  429. X                  
  430. X!             case 'c':    /* catchup - mark all articles as read */
  431. X!             case 'C':    /* and goto next group */
  432. X                  if (!confirm_action || prompt_yn (LINES, txt_mark_all_read, 'y')) {
  433. X                      for (n = 0; n < top; n++) {
  434. X                          arts[n].unread = ART_READ;
  435. X                      }
  436. X+                     ret_code = (ch == 'C' ? -4 : -1);
  437. X                      fix_new_highest (cur_groupnum);
  438. X                      if (cur_groupnum + 1 < group_top) {
  439. X                          cur_groupnum++;
  440. X+                     } else {
  441. X+                         ret_code = -1;
  442. X                      }
  443. X                      art_close ();
  444. X!                     space_mode = TRUE;
  445. X!                     return ret_code;
  446. X                  }
  447. X                  break;
  448. X  
  449. X!             case 'D':    /* delete an article */
  450. X!                 if (delete_article (group, respnum)) {
  451. X                      redraw_page (respnum, group);
  452. X                  }
  453. X                  break;
  454. X***************
  455. X*** 375,381 ****
  456. X                      info_message (txt_cannot_post);
  457. X                      break;
  458. X                  }
  459. X!                 copy_text = (ch == 'f' ? FALSE : TRUE);
  460. X                  ret_code = post_response (group, respnum, copy_text);
  461. X                  redraw_page (respnum, group);
  462. X                  break;
  463. X--- 386,392 ----
  464. X                      info_message (txt_cannot_post);
  465. X                      break;
  466. X                  }
  467. X!                 copy_text = (ch == 'f' ? TRUE : FALSE);
  468. X                  ret_code = post_response (group, respnum, copy_text);
  469. X                  redraw_page (respnum, group);
  470. X                  break;
  471. X***************
  472. X*** 502,508 ****
  473. X      
  474. X              case 'r':    /* reply to author through mail */
  475. X              case 'R':
  476. X!                 copy_text = (ch == 'r' ? FALSE : TRUE);
  477. X                  mail_to_author (group, respnum, copy_text);
  478. X                  redraw_page (respnum, group);
  479. X                  break;
  480. X--- 513,519 ----
  481. X      
  482. X              case 'r':    /* reply to author through mail */
  483. X              case 'R':
  484. X!                 copy_text = (ch == 'r' ? TRUE : FALSE);
  485. X                  mail_to_author (group, respnum, copy_text);
  486. X                  redraw_page (respnum, group);
  487. X                  break;
  488. X***************
  489. X*** 686,691 ****
  490. X--- 697,703 ----
  491. X          if (first) {
  492. X              StartInverse ();
  493. X          }    
  494. X+         strip_line (buf2, strlen (buf2));
  495. X          printf("%s\r\n", buf2);
  496. X          if (first) {
  497. X              EndInverse ();
  498. X***************
  499. X*** 743,754 ****
  500. X      int respnum;
  501. X      char *group;
  502. X  {
  503. X-     int whichresp;
  504. X-     int x_resp;
  505. X      char buf[LEN];
  506. X      char tmp[LEN];
  507. X!     int pos, i;
  508. X!     int n;
  509. X  
  510. X      whichresp = which_response (respnum);
  511. X      x_resp = num_of_responses (which_thread (respnum));
  512. X--- 755,766 ----
  513. X      int respnum;
  514. X      char *group;
  515. X  {
  516. X      char buf[LEN];
  517. X      char tmp[LEN];
  518. X!     int whichresp;
  519. X!     int x_resp;
  520. X!     int pos, i, n;
  521. X!     struct tm *tm;
  522. X  
  523. X      whichresp = which_response (respnum);
  524. X      x_resp = num_of_responses (which_thread (respnum));
  525. X***************
  526. X*** 755,779 ****
  527. X  
  528. X      ClearScreen ();
  529. X  
  530. X!     strcpy (buf, note_h_date);
  531. X      pos = (COLS - (int) strlen (group)) / 2;
  532. X!     for (i = strlen(buf); i < pos; i++)
  533. X          buf[i] = ' ';
  534. X      buf[i] = '\0';
  535. X  
  536. X      strcat (buf, group);
  537. X  
  538. X!     for (i = strlen(buf); i < RIGHT_POS ; i++)
  539. X          buf[i] = ' ';
  540. X      buf[i] = '\0';
  541. X  
  542. X!     printf (txt_thread_x_of_n, buf, which_thread (respnum) + 1, top_base);
  543. X  
  544. X      sprintf (buf, txt_art, arts[respnum].artnum);
  545. X      n = strlen (buf);
  546. X      fputs (buf, stdout);
  547. X  
  548. X!     strcpy (buf, note_h_subj);
  549. X      buf[RIGHT_POS - 5 - n] = '\0';
  550. X  
  551. X      pos = ((COLS - (int) strlen (buf)) / 2) - 2;
  552. X--- 767,802 ----
  553. X  
  554. X      ClearScreen ();
  555. X  
  556. X!     tm = localtime (&arts[respnum].date);
  557. X!     if (! my_strftime (buf, sizeof (buf), "%a, %d %b %Y %H:%M:%S", tm)) {
  558. X!         strcpy (buf, note_h_date);
  559. X!     }
  560. X! 
  561. X      pos = (COLS - (int) strlen (group)) / 2;
  562. X!     for (i = strlen(buf); i < pos; i++) {
  563. X          buf[i] = ' ';
  564. X+     }
  565. X      buf[i] = '\0';
  566. X  
  567. X      strcat (buf, group);
  568. X  
  569. X!     for (i = strlen(buf); i < RIGHT_POS ; i++) {
  570. X          buf[i] = ' ';
  571. X+     }
  572. X      buf[i] = '\0';
  573. X  
  574. X!     sprintf (tmp, txt_thread_x_of_n, buf, which_thread (respnum) + 1, top_base);
  575. X!     fputs (tmp, stdout);
  576. X  
  577. X      sprintf (buf, txt_art, arts[respnum].artnum);
  578. X      n = strlen (buf);
  579. X      fputs (buf, stdout);
  580. X  
  581. X!     if (note_h_subj[0]) {
  582. X!         strcpy (buf, note_h_subj);
  583. X!     } else {
  584. X!         strcpy (buf, arts[respnum].subject);
  585. X!     }
  586. X      buf[RIGHT_POS - 5 - n] = '\0';
  587. X  
  588. X      pos = ((COLS - (int) strlen (buf)) / 2) - 2;
  589. X***************
  590. X*** 801,813 ****
  591. X      }
  592. X  
  593. X      if (*note_h_org) {
  594. X!         if (strcmp (arts[respnum].from, arts[respnum].name) == 0) {
  595. X!             strcpy (tmp, note_h_org);
  596. X!         } else {
  597. X              sprintf (tmp, txt_s_at_s, arts[respnum].name, note_h_org);
  598. X          }
  599. X!     } else {
  600. X          strcpy (tmp, arts[respnum].name);
  601. X      }
  602. X  
  603. X      tmp[LEN-1] = '\0';
  604. X--- 824,838 ----
  605. X      }
  606. X  
  607. X      if (*note_h_org) {
  608. X!         if (arts[respnum].name) {
  609. X              sprintf (tmp, txt_s_at_s, arts[respnum].name, note_h_org);
  610. X+         } else {
  611. X+             strcpy (tmp, note_h_org);
  612. X          }
  613. X!     } else if (arts[respnum].name) {
  614. X          strcpy (tmp, arts[respnum].name);
  615. X+     } else {
  616. X+         strcpy (tmp, " ");
  617. X      }
  618. X  
  619. X      tmp[LEN-1] = '\0';
  620. X***************
  621. X*** 824,829 ****
  622. X--- 849,855 ----
  623. X          buf[i] = '\0';
  624. X          strcat (buf, tmp);
  625. X      }
  626. X+     strip_line (buf, strlen (buf));
  627. X      printf ("%s\r\n\r\n", buf);
  628. X  
  629. X      note_line += 4;
  630. X***************
  631. X*** 836,842 ****
  632. X      int maxresp;
  633. X      int whichresp;
  634. X      int whichbase;
  635. X!     char buf[PATH_LEN];
  636. X  
  637. X      whichresp = which_response (respnum);
  638. X      whichbase = which_thread (respnum);
  639. X--- 862,868 ----
  640. X      int maxresp;
  641. X      int whichresp;
  642. X      int whichbase;
  643. X!     char buf[LEN];
  644. X  
  645. X      whichresp = which_response (respnum);
  646. X      whichbase = which_thread (respnum);
  647. X***************
  648. X*** 844,850 ****
  649. X  
  650. X      assert (whichbase < top_base);
  651. X  
  652. X!     if (whichresp)
  653. X          sprintf(buf, txt_thread_resp_page,
  654. X              whichbase + 1,
  655. X              top_base,
  656. X--- 870,876 ----
  657. X  
  658. X      assert (whichbase < top_base);
  659. X  
  660. X!     if (whichresp) {
  661. X          sprintf(buf, txt_thread_resp_page,
  662. X              whichbase + 1,
  663. X              top_base,
  664. X***************
  665. X*** 852,865 ****
  666. X              maxresp,
  667. X              note_page + 1,
  668. X              note_h_subj);
  669. X!     else
  670. X          sprintf(buf, txt_thread_page,
  671. X              whichbase + 1,
  672. X              top_base,
  673. X              note_page + 1,
  674. X              note_h_subj);
  675. X! 
  676. X!     buf[COLS-1] = '\0';
  677. X      printf("%s\r\n\r\n", buf);
  678. X  
  679. X      note_line += 2;
  680. X--- 878,892 ----
  681. X              maxresp,
  682. X              note_page + 1,
  683. X              note_h_subj);
  684. X!     } else {
  685. X          sprintf(buf, txt_thread_page,
  686. X              whichbase + 1,
  687. X              top_base,
  688. X              note_page + 1,
  689. X              note_h_subj);
  690. X!     }
  691. X!     strip_line (buf, strlen (buf));
  692. X!     /* buf[COLS-1] = '\0'; */
  693. X      printf("%s\r\n\r\n", buf);
  694. X  
  695. X      note_line += 2;
  696. X***************
  697. X*** 870,883 ****
  698. X      long art;
  699. X      char *group_path;
  700. X  {
  701. X!     char buf[1025];
  702. X!     char *p;
  703. X  
  704. X      note_page = 0;
  705. X  
  706. X      art_close ();    /* just in case */
  707. X  
  708. X!     if ((note_fp = open_art_fp (group_path, art)) == NULL) {
  709. X          return (ART_UNAVAILABLE);
  710. X      }
  711. X  
  712. X--- 897,910 ----
  713. X      long art;
  714. X      char *group_path;
  715. X  {
  716. X!     char buf[8192];
  717. X!     char *ptr;
  718. X  
  719. X      note_page = 0;
  720. X  
  721. X      art_close ();    /* just in case */
  722. X  
  723. X!     if ((note_fp = open_art_fp (group_path, art)) == (FILE *) 0) {
  724. X          return (ART_UNAVAILABLE);
  725. X      }
  726. X  
  727. X***************
  728. X*** 891,903 ****
  729. X      note_h_followup[0] = '\0';
  730. X  
  731. X      while (fgets(buf, sizeof buf, note_fp) != NULL) {
  732. X!         buf[1024] = '\0';
  733. X  
  734. X!         for (p=buf ; *p && *p != '\n' ; p++) {
  735. X!             if (((*p) & 0xFF) < ' ')
  736. X!                 *p = ' ';
  737. X          }
  738. X!         *p = '\0';
  739. X          
  740. X          if (*buf == '\0')
  741. X              break;
  742. X--- 918,930 ----
  743. X      note_h_followup[0] = '\0';
  744. X  
  745. X      while (fgets(buf, sizeof buf, note_fp) != NULL) {
  746. X!         buf[8191] = '\0';
  747. X  
  748. X!         for (ptr = buf ; *ptr && *ptr != '\n' ; ptr++) {
  749. X!             if (((*ptr) & 0xFF) < ' ')
  750. X!                 *ptr = ' ';
  751. X          }
  752. X!         *ptr = '\0';
  753. X          
  754. X          if (*buf == '\0')
  755. X              break;
  756. X***************
  757. X*** 906,922 ****
  758. X                continue;
  759. X            if (match_header (buf, "Subject", note_h_subj, LEN))
  760. X                continue;
  761. X!           if (match_header (buf, "Organization", note_h_org, LEN))
  762. X                continue;
  763. X!           if (match_header (buf, "Date", note_h_date, LEN))
  764. X                continue;
  765. X            if (match_header (buf, "Newsgroups", note_h_newsgroups, LEN))
  766. X                continue;
  767. X!           if (match_header (buf, "Message-ID", note_h_messageid, LEN))
  768. X                continue;
  769. X!           if (match_header (buf, "Message-Id", note_h_messageid, LEN))
  770. X                continue;
  771. X!           if (match_header (buf, "Distribution", note_h_distrib, LEN))
  772. X                continue;
  773. X            if (match_header (buf, "Followup-To", note_h_followup, LEN))
  774. X                continue;
  775. X--- 933,949 ----
  776. X                continue;
  777. X            if (match_header (buf, "Subject", note_h_subj, LEN))
  778. X                continue;
  779. X!           if (match_header (buf, "Organization", note_h_org, PATH_LEN))
  780. X                continue;
  781. X!           if (match_header (buf, "Date", note_h_date, PATH_LEN))
  782. X                continue;
  783. X            if (match_header (buf, "Newsgroups", note_h_newsgroups, LEN))
  784. X                continue;
  785. X!           if (match_header (buf, "Message-ID", note_h_messageid, PATH_LEN))
  786. X                continue;
  787. X!           if (match_header (buf, "Message-Id", note_h_messageid, PATH_LEN))
  788. X                continue;
  789. X!           if (match_header (buf, "Distribution", note_h_distrib, PATH_LEN))
  790. X                continue;
  791. X            if (match_header (buf, "Followup-To", note_h_followup, LEN))
  792. X                continue;
  793. X***************
  794. X*** 925,930 ****
  795. X--- 952,967 ----
  796. X      note_mark[0] = ftell (note_fp);
  797. X      note_end = FALSE;
  798. X  
  799. X+     /*
  800. X+      * If Newsgroups is empty its a good bet the article is a mail article
  801. X+      */
  802. X+     if (! note_h_newsgroups[0]) {
  803. X+         strcpy (note_h_newsgroups, group_path);
  804. X+         while (ptr = (char *) strchr (note_h_newsgroups, '/')) {
  805. X+             *ptr = '.';
  806. X+         }
  807. X+     }
  808. X+     
  809. X      return (0);
  810. X  }
  811. X  
  812. Xdiff -rcs ../1.16/parsedate.y ./parsedate.y
  813. X*** ../1.16/parsedate.y    Sun Nov 15 18:42:01 1992
  814. X--- ./parsedate.y    Fri Sep 18 13:31:03 1992
  815. X***************
  816. X*** 2,10 ****
  817. X  /*
  818. X   *  Project   : tin - a threaded Netnews reader
  819. X   *  Module    : parsedate.y
  820. X!  *  Author    : S.Bellovin & R.$alz & J.Berets 
  821. X   *  Created   : 01-08-90
  822. X!  *  Updated   : 04-09-92
  823. X   *  Notes     : This grammar has 6 shift/reduce conflicts.
  824. X   *              Originally written by Steven M. Bellovin <smb@research.att.com> 
  825. X   *              while at the University of North Carolina at Chapel Hill.  
  826. X--- 2,10 ----
  827. X  /*
  828. X   *  Project   : tin - a threaded Netnews reader
  829. X   *  Module    : parsedate.y
  830. X!  *  Author    : S.Bellovin & R.$alz & J.Berets & P.Eggert
  831. X   *  Created   : 01-08-90
  832. X!  *  Updated   : 18-09-92
  833. X   *  Notes     : This grammar has 6 shift/reduce conflicts.
  834. X   *              Originally written by Steven M. Bellovin <smb@research.att.com> 
  835. X   *              while at the University of North Carolina at Chapel Hill.  
  836. X***************
  837. X*** 13,19 ****
  838. X   *              <jberets@bbn.com> in August, 1990. 
  839. X   *              Further revised (removed obsolete constructs and cleaned up 
  840. X   *              timezone names) in August, 1991, by Rich.
  841. X!  *  Revision  : 1.11
  842. X   *  Copyright : This code is in the public domain and has no copyright.
  843. X   */
  844. X  
  845. X--- 13,20 ----
  846. X   *              <jberets@bbn.com> in August, 1990. 
  847. X   *              Further revised (removed obsolete constructs and cleaned up 
  848. X   *              timezone names) in August, 1991, by Rich.
  849. X!  *              Paul Eggert <eggert@twinsun.com> helped in September 1992.
  850. X!  *  Revision  : 1.12
  851. X   *  Copyright : This code is in the public domain and has no copyright.
  852. X   */
  853. X  
  854. X***************
  855. X*** 35,41 ****
  856. X  
  857. X  typedef char    *STRING;
  858. X  
  859. X- 
  860. X  #define yyparse        date_parse
  861. X  #define yylex        date_lex
  862. X  #define yyerror        date_error
  863. X--- 36,41 ----
  864. X***************
  865. X*** 42,57 ****
  866. X  
  867. X  
  868. X      /* See the LeapYears table in Convert. */
  869. X! #define EPOCH        1970
  870. X! #define END_OF_TIME    2038
  871. X      /* Constants for general time calculations. */
  872. X  #define DST_OFFSET    1
  873. X  #define SECSPERDAY    (24L * 60L * 60L)
  874. X!     /* Readability ends for TABLE stuff. */
  875. X  #define HOUR(x)        (x * 60)
  876. X  #define LPAREN        '('
  877. X  #define RPAREN        ')'
  878. X  
  879. X  /*
  880. X  **  An entry in the lexical lookup table.
  881. X  */
  882. X--- 42,65 ----
  883. X  
  884. X  
  885. X      /* See the LeapYears table in Convert. */
  886. X! #ifdef AMIGA
  887. X! #    define EPOCH        1978
  888. X! #    define END_OF_TIME    2046
  889. X! #else
  890. X! #    define EPOCH        1970
  891. X! #    define END_OF_TIME    2038
  892. X! #endif
  893. X      /* Constants for general time calculations. */
  894. X  #define DST_OFFSET    1
  895. X  #define SECSPERDAY    (24L * 60L * 60L)
  896. X!     /* Readability for TABLE stuff. */
  897. X  #define HOUR(x)        (x * 60)
  898. X+ 
  899. X  #define LPAREN        '('
  900. X  #define RPAREN        ')'
  901. X+ #define IS7BIT(x)    ((unsigned int)(x) < 0200)
  902. X  
  903. X+ 
  904. X  /*
  905. X  **  An entry in the lexical lookup table.
  906. X  */
  907. X***************
  908. X*** 206,219 ****
  909. X      ;
  910. X  
  911. X  numzone    : tSNUMBER {
  912. X          /* Unix and GMT and numeric timezones -- a little confusing. */
  913. X          if ($1 < 0) {
  914. X          /* Don't work with negative modulus. */
  915. X          $1 = -$1;
  916. X!         $$ = ($1 / 100) * 60 + $1 % 100;
  917. X          }
  918. X-         else
  919. X-         $$ = -(($1 / 100) * 60 + $1 % 100);
  920. X      }
  921. X      ;
  922. X  
  923. X--- 214,236 ----
  924. X      ;
  925. X  
  926. X  numzone    : tSNUMBER {
  927. X+         int    i;
  928. X+                     
  929. X          /* Unix and GMT and numeric timezones -- a little confusing. */
  930. X          if ($1 < 0) {
  931. X          /* Don't work with negative modulus. */
  932. X          $1 = -$1;
  933. X!          if ($1 > 9999 || (i = $1 % 100) >= 60) {
  934. X!              YYABORT;
  935. X!          }
  936. X!         $$ = ($1 / 100) * 60 + i;
  937. X!         }
  938. X!         else {
  939. X!          if ($1 > 9999 || (i = $1 % 100) >= 60) {
  940. X!              YYABORT;
  941. X!          }
  942. X!         $$ = -(($1 / 100) * 60 + i);
  943. X          }
  944. X      }
  945. X      ;
  946. X  
  947. X***************
  948. X*** 483,492 ****
  949. X--- 500,516 ----
  950. X      static int    DaysLeap[13] = {
  951. X      0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
  952. X      };
  953. X+ #ifdef AMIGA
  954. X+     static int    LeapYears[] = {
  955. X+     1980, 1984, 1988, 1992, 1996, 2000, 2004, 2008, 2012, 2016, 
  956. X+     2020, 2024, 2028, 2032, 2036, 2040, 2044
  957. X+     };
  958. X+ #else
  959. X      static int    LeapYears[] = {
  960. X      1972, 1976, 1980, 1984, 1988, 1992, 1996,
  961. X      2000, 2004, 2008, 2012, 2016, 2020, 2024, 2028, 2032, 2036
  962. X      };
  963. X+ #endif
  964. X      register int    *yp;
  965. X      register int    *mp;
  966. X      register time_t    Julian;
  967. X***************
  968. X*** 570,583 ****
  969. X      register char    *p;
  970. X      register STRING    q;
  971. X      register TABLE    *tp;
  972. X  
  973. X      p = buff;
  974. X! 
  975. X      /* See if we have an abbreviation for a month. */
  976. X      if (length == 3 || (length == 4 && p[3] == '.'))
  977. X      for (tp = MonthDayTable; tp < ENDOF(MonthDayTable); tp++) {
  978. X          q = tp->name;
  979. X!         if (p[0] == q[0] && p[1] == q[1] && p[2] == q[2]) {
  980. X          yylval.Number = tp->value;
  981. X          return tp->type;
  982. X          }
  983. X--- 594,609 ----
  984. X      register char    *p;
  985. X      register STRING    q;
  986. X      register TABLE    *tp;
  987. X+     register int    c;
  988. X  
  989. X      p = buff;
  990. X!     c = p[0];
  991. X!     
  992. X      /* See if we have an abbreviation for a month. */
  993. X      if (length == 3 || (length == 4 && p[3] == '.'))
  994. X      for (tp = MonthDayTable; tp < ENDOF(MonthDayTable); tp++) {
  995. X          q = tp->name;
  996. X!         if (c == q[0] && p[1] == q[1] && p[2] == q[2]) {
  997. X          yylval.Number = tp->value;
  998. X          return tp->type;
  999. X          }
  1000. X***************
  1001. X*** 584,590 ****
  1002. X      }
  1003. X      else
  1004. X      for (tp = MonthDayTable; tp < ENDOF(MonthDayTable); tp++)
  1005. X!         if (p[0] == tp->name[0] && strcmp(p, tp->name) == 0) {
  1006. X          yylval.Number = tp->value;
  1007. X          return tp->type;
  1008. X          }
  1009. X--- 610,616 ----
  1010. X      }
  1011. X      else
  1012. X      for (tp = MonthDayTable; tp < ENDOF(MonthDayTable); tp++)
  1013. X!         if (c == tp->name[0] && strcmp(p, tp->name) == 0) {
  1014. X          yylval.Number = tp->value;
  1015. X          return tp->type;
  1016. X          }
  1017. X***************
  1018. X*** 591,597 ****
  1019. X  
  1020. X      /* Try for a timezone. */
  1021. X      for (tp = TimezoneTable; tp < ENDOF(TimezoneTable); tp++)
  1022. X!     if (p[0] == tp->name[0] && p[1] == tp->name[1]
  1023. X       && strcmp(p, tp->name) == 0) {
  1024. X          yylval.Number = tp->value;
  1025. X          return tp->type;
  1026. X--- 617,623 ----
  1027. X  
  1028. X      /* Try for a timezone. */
  1029. X      for (tp = TimezoneTable; tp < ENDOF(TimezoneTable); tp++)
  1030. X!     if (c == tp->name[0] && p[1] == tp->name[1]
  1031. X       && strcmp(p, tp->name) == 0) {
  1032. X          yylval.Number = tp->value;
  1033. X          return tp->type;
  1034. X***************
  1035. X*** 599,605 ****
  1036. X  
  1037. X      /* Try the units table. */
  1038. X      for (tp = UnitsTable; tp < ENDOF(UnitsTable); tp++)
  1039. X!     if (p[0] == tp->name[0] && strcmp(p, tp->name) == 0) {
  1040. X          yylval.Number = tp->value;
  1041. X          return tp->type;
  1042. X      }
  1043. X--- 625,631 ----
  1044. X  
  1045. X      /* Try the units table. */
  1046. X      for (tp = UnitsTable; tp < ENDOF(UnitsTable); tp++)
  1047. X!     if (c == tp->name[0] && strcmp(p, tp->name) == 0) {
  1048. X          yylval.Number = tp->value;
  1049. X          return tp->type;
  1050. X      }
  1051. X***************
  1052. X*** 608,614 ****
  1053. X      if (--length > 0 && p[length] == 's') {
  1054. X      p[length] = '\0';
  1055. X      for (tp = UnitsTable; tp < ENDOF(UnitsTable); tp++)
  1056. X!         if (p[0] == tp->name[0] && strcmp(p, tp->name) == 0) {
  1057. X          p[length] = 's';
  1058. X          yylval.Number = tp->value;
  1059. X          return tp->type;
  1060. X--- 634,640 ----
  1061. X      if (--length > 0 && p[length] == 's') {
  1062. X      p[length] = '\0';
  1063. X      for (tp = UnitsTable; tp < ENDOF(UnitsTable); tp++)
  1064. X!         if (c == tp->name[0] && strcmp(p, tp->name) == 0) {
  1065. X          p[length] = 's';
  1066. X          yylval.Number = tp->value;
  1067. X          return tp->type;
  1068. X***************
  1069. X*** 636,649 ****
  1070. X      }
  1071. X  
  1072. X      /* If we saw any periods, try the timezones again. */
  1073. X!     if (p - buff != length)
  1074. X      for (p = buff, tp = TimezoneTable; tp < ENDOF(TimezoneTable); tp++)
  1075. X!         if (p[0] == tp->name[0] && p[1] == tp->name[1]
  1076. X          && strcmp(p, tp->name) == 0) {
  1077. X          yylval.Number = tp->value;
  1078. X          return tp->type;
  1079. X          }
  1080. X! 
  1081. X      /* Unknown word -- assume GMT timezone. */
  1082. X      yylval.Number = 0;
  1083. X      return tZONE;
  1084. X--- 662,677 ----
  1085. X      }
  1086. X  
  1087. X      /* If we saw any periods, try the timezones again. */
  1088. X!     if (p - buff != length) {
  1089. X!     c = buff[0];    
  1090. X      for (p = buff, tp = TimezoneTable; tp < ENDOF(TimezoneTable); tp++)
  1091. X!         if (c == tp->name[0] && p[1] == tp->name[1]
  1092. X          && strcmp(p, tp->name) == 0) {
  1093. X          yylval.Number = tp->value;
  1094. X          return tp->type;
  1095. X          }
  1096. X!     }
  1097. X!     
  1098. X      /* Unknown word -- assume GMT timezone. */
  1099. X      yylval.Number = 0;
  1100. X      return tZONE;
  1101. X***************
  1102. X*** 658,677 ****
  1103. X      char        buff[20];
  1104. X      register int    sign;
  1105. X      register int    i;
  1106. X  
  1107. X      for ( ; ; ) {
  1108. X      /* Get first character after the whitespace. */
  1109. X!     while (CTYPE(isspace, *yyInput))
  1110. X!         yyInput++;
  1111. X!     c = *yyInput;
  1112. X!     /* Ignore timezone comments. */
  1113. X!     if (c == LPAREN) {
  1114. X!         while ((c == *++yyInput) != '\0' && c != RPAREN)
  1115. X!         continue;
  1116. X!         if (c == RPAREN) {
  1117. X          yyInput++;
  1118. X!         continue;
  1119. X!         }
  1120. X      }
  1121. X  
  1122. X      /* A number? */
  1123. X--- 686,711 ----
  1124. X      char        buff[20];
  1125. X      register int    sign;
  1126. X      register int    i;
  1127. X+     register int    nesting;
  1128. X  
  1129. X      for ( ; ; ) {
  1130. X      /* Get first character after the whitespace. */
  1131. X!     for ( ; ; ) {
  1132. X!         while (CTYPE(isspace, *yyInput))
  1133. X          yyInput++;
  1134. X!         c = *yyInput;
  1135. X! 
  1136. X!         /* Ignore RFC 822 comments, typically time zone names. */
  1137. X!         if (c != LPAREN)
  1138. X!         break;
  1139. X!         for (nesting = 1; (c = *++yyInput) != RPAREN || --nesting; )
  1140. X!         if (c == LPAREN)
  1141. X!             nesting++;
  1142. X!         else if (!IS7BIT(c) || c == '\0' || c == '\r'
  1143. X!              || (c == '\\' && ((c = *++yyInput) == '\0' || !IS7BIT(c))))
  1144. X!             /* Lexical error: bad comment. */
  1145. X!             return '?';
  1146. X!         yyInput++;
  1147. X      }
  1148. X  
  1149. X      /* A number? */
  1150. Xdiff -rcs ../1.16/patchlev.h ./patchlev.h
  1151. X*** ../1.16/patchlev.h    Sun Nov 15 18:41:43 1992
  1152. X--- ./patchlev.h    Sun Nov 15 16:02:48 1992
  1153. X***************
  1154. X*** 3,9 ****
  1155. X   *  Module    : patchlev.h
  1156. X   *  Author    : I.Lea
  1157. X   *  Created   : 01-04-91
  1158. X!  *  Updated   : 12-08-92
  1159. X   *  Notes     :
  1160. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  1161. X   *              You may  freely  copy or  redistribute  this software,
  1162. X--- 3,9 ----
  1163. X   *  Module    : patchlev.h
  1164. X   *  Author    : I.Lea
  1165. X   *  Created   : 01-04-91
  1166. X!  *  Updated   : 14-09-92
  1167. X   *  Notes     :
  1168. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  1169. X   *              You may  freely  copy or  redistribute  this software,
  1170. X***************
  1171. X*** 13,16 ****
  1172. X   */
  1173. X  
  1174. X  #define VERSION        "1.1"        /* Beta versions are "1.n Beta" */
  1175. X! #define PATCHLEVEL    6
  1176. X--- 13,16 ----
  1177. X   */
  1178. X  
  1179. X  #define VERSION        "1.1"        /* Beta versions are "1.n Beta" */
  1180. X! #define PATCHLEVEL    7
  1181. Xdiff -rcs ../1.16/post.c ./post.c
  1182. X*** ../1.16/post.c    Sun Nov 15 18:42:02 1992
  1183. X--- ./post.c    Sun Nov 15 16:02:48 1992
  1184. X***************
  1185. X*** 3,9 ****
  1186. X   *  Module    : post.c
  1187. X   *  Author    : I.Lea
  1188. X   *  Created   : 01-04-91
  1189. X!  *  Updated   : 11-09-92
  1190. X   *  Notes     : mail/post/replyto/followup/crosspost & cancel articles
  1191. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  1192. X   *              You may  freely  copy or  redistribute  this software,
  1193. X--- 3,9 ----
  1194. X   *  Module    : post.c
  1195. X   *  Author    : I.Lea
  1196. X   *  Created   : 01-04-91
  1197. X!  *  Updated   : 07-11-92
  1198. X   *  Notes     : mail/post/replyto/followup/crosspost & cancel articles
  1199. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  1200. X   *              You may  freely  copy or  redistribute  this software,
  1201. X***************
  1202. X*** 16,27 ****
  1203. X  
  1204. X  #define    PRINT_LF()    Raw (FALSE); fputc ('\n', stdout); fflush (stdout); Raw (TRUE);
  1205. X  
  1206. X! extern char note_h_distrib[LEN];        /* Distribution: */
  1207. X  extern char note_h_followup[LEN];        /* Followup-To: */
  1208. X! extern char note_h_messageid[LEN];        /* Message-ID:    */
  1209. X  extern char note_h_newsgroups[LEN];        /* Newsgroups:    */
  1210. X  extern char note_h_subj[LEN];            /* Subject:    */
  1211. X! extern char note_h_date[LEN];            /* Date:    */
  1212. X  extern FILE *note_fp;                /* the body of the current article */
  1213. X  extern long note_mark[MAX_PAGES];        /* ftells on beginnings of pages */
  1214. X  
  1215. X--- 16,27 ----
  1216. X  
  1217. X  #define    PRINT_LF()    Raw (FALSE); fputc ('\n', stdout); fflush (stdout); Raw (TRUE);
  1218. X  
  1219. X! extern char note_h_distrib[PATH_LEN];        /* Distribution: */
  1220. X  extern char note_h_followup[LEN];        /* Followup-To: */
  1221. X! extern char note_h_messageid[PATH_LEN];        /* Message-ID:    */
  1222. X  extern char note_h_newsgroups[LEN];        /* Newsgroups:    */
  1223. X  extern char note_h_subj[LEN];            /* Subject:    */
  1224. X! extern char note_h_date[PATH_LEN];        /* Date:    */
  1225. X  extern FILE *note_fp;                /* the body of the current article */
  1226. X  extern long note_mark[MAX_PAGES];        /* ftells on beginnings of pages */
  1227. X  
  1228. X***************
  1229. X*** 227,234 ****
  1230. X      sprintf (buf, txt_post_newsgroups, default_post_newsgroups);
  1231. X      
  1232. X      if (! prompt_string (buf, group)) {
  1233. X- /*        Raw(FALSE);
  1234. X- */
  1235. X          fprintf (stderr, "%s\n", txt_no_quick_newsgroups);
  1236. X          return;
  1237. X      }
  1238. X--- 227,232 ----
  1239. X***************
  1240. X*** 240,247 ****
  1241. X          if (default_post_newsgroups[0]) {
  1242. X              my_strncpy (group, default_post_newsgroups, sizeof (group));
  1243. X          } else {
  1244. X- /*            Raw(FALSE);
  1245. X- */
  1246. X              fprintf (stderr, "%s\n", txt_no_quick_newsgroups);
  1247. X              return;
  1248. X          }
  1249. X--- 238,243 ----
  1250. X***************
  1251. X*** 305,311 ****
  1252. X      }
  1253. X      
  1254. X      PRINT_LF();
  1255. X!     start_line_offset = 7;
  1256. X  
  1257. X      if ((fp = fopen (article, "w")) == NULL) {
  1258. X          Raw (FALSE);
  1259. X--- 301,307 ----
  1260. X      }
  1261. X      
  1262. X      PRINT_LF();
  1263. X!     start_line_offset = 6;
  1264. X  
  1265. X      if ((fp = fopen (article, "w")) == NULL) {
  1266. X          Raw (FALSE);
  1267. X***************
  1268. X*** 314,323 ****
  1269. X      }
  1270. X      chmod (article, 0600);
  1271. X  
  1272. X      fprintf (fp, "Subject: %s\n", subj);
  1273. X      fprintf (fp, "Newsgroups: %s\n", group);
  1274. X!     if (*my_org) {
  1275. X!         fprintf (fp, "Organization: %s\n", my_org);
  1276. X          start_line_offset++;
  1277. X      }
  1278. X      if (*reply_to) {
  1279. X--- 310,322 ----
  1280. X      }
  1281. X      chmod (article, 0600);
  1282. X  
  1283. X+ /* FIXME so that group only conatains 1 group when finding an index number */
  1284. X+ i = find_group_index (group);
  1285. X+ 
  1286. X      fprintf (fp, "Subject: %s\n", subj);
  1287. X      fprintf (fp, "Newsgroups: %s\n", group);
  1288. X!     if (i >= 0 && active[i].attribute.organization != (char *) 0) {
  1289. X!         fprintf (fp, "Organization: %s\n", active[i].attribute.organization);
  1290. X          start_line_offset++;
  1291. X      }
  1292. X      if (*reply_to) {
  1293. X***************
  1294. X*** 324,336 ****
  1295. X          fprintf (fp, "Reply-To: %s\n", reply_to);
  1296. X          start_line_offset++;
  1297. X      }
  1298. X! i = find_group_index (group);
  1299. X! if (i >= 0 && active[i].attribute.followup_to != (char *) 0) {
  1300. X! fprintf (fp, "Followup-To: %s\n", active[i].attribute.followup_to);
  1301. X! start_line_offset++;
  1302. X! }
  1303. X      if (*my_distribution) {
  1304. X          fprintf (fp, "Distribution: %s\n", my_distribution);
  1305. X      }
  1306. X      fprintf (fp, "Summary: \n");
  1307. X      fprintf (fp, "Keywords: \n\n\n");
  1308. X--- 323,335 ----
  1309. X          fprintf (fp, "Reply-To: %s\n", reply_to);
  1310. X          start_line_offset++;
  1311. X      }
  1312. X!     if (i >= 0 && active[i].attribute.followup_to != (char *) 0) {
  1313. X!         fprintf (fp, "Followup-To: %s\n", active[i].attribute.followup_to);
  1314. X!         start_line_offset++;
  1315. X!     }
  1316. X      if (*my_distribution) {
  1317. X          fprintf (fp, "Distribution: %s\n", my_distribution);
  1318. X+         start_line_offset++;
  1319. X      }
  1320. X      fprintf (fp, "Summary: \n");
  1321. X      fprintf (fp, "Keywords: \n\n\n");
  1322. X***************
  1323. X*** 439,445 ****
  1324. X      }
  1325. X      
  1326. X      *posted = FALSE;
  1327. X!     start_line_offset = 7;
  1328. X  
  1329. X      if (active[my_group[cur_groupnum]].moderated == 'm') {
  1330. X          sprintf (msg, "Group %s is moderated. Continue? (y/n): ", group);
  1331. X--- 438,444 ----
  1332. X      }
  1333. X      
  1334. X      *posted = FALSE;
  1335. X!     start_line_offset = 6;
  1336. X  
  1337. X      if (active[my_group[cur_groupnum]].moderated == 'm') {
  1338. X          sprintf (msg, "Group %s is moderated. Continue? (y/n): ", group);
  1339. X***************
  1340. X*** 476,485 ****
  1341. X      }
  1342. X      chmod (article, 0600);
  1343. X  
  1344. X      fprintf (fp, "Subject: %s\n", subj);
  1345. X      fprintf (fp, "Newsgroups: %s\n", group);
  1346. X!     if (*my_org) {
  1347. X!         fprintf (fp, "Organization: %s\n", my_org);
  1348. X          start_line_offset++;
  1349. X      }
  1350. X      if (*reply_to) {
  1351. X--- 475,486 ----
  1352. X      }
  1353. X      chmod (article, 0600);
  1354. X  
  1355. X+     i = find_group_index (group);
  1356. X+ 
  1357. X      fprintf (fp, "Subject: %s\n", subj);
  1358. X      fprintf (fp, "Newsgroups: %s\n", group);
  1359. X!     if (i >= 0 && active[i].attribute.organization != (char *) 0) {
  1360. X!         fprintf (fp, "Organization: %s\n", active[i].attribute.organization);
  1361. X          start_line_offset++;
  1362. X      }
  1363. X      if (*reply_to) {
  1364. X***************
  1365. X*** 486,492 ****
  1366. X          fprintf (fp, "Reply-To: %s\n", reply_to);
  1367. X          start_line_offset++;
  1368. X      }
  1369. X-     i = find_group_index (group);
  1370. X      if (i >= 0 && active[i].attribute.followup_to != (char *) 0) {
  1371. X          fprintf (fp, "Followup-To: %s\n", active[i].attribute.followup_to);
  1372. X          start_line_offset++;
  1373. X--- 487,492 ----
  1374. X***************
  1375. X*** 493,498 ****
  1376. X--- 493,499 ----
  1377. X      }
  1378. X      if (*my_distribution) {
  1379. X          fprintf (fp, "Distribution: %s\n", my_distribution);
  1380. X+         start_line_offset++;
  1381. X      }
  1382. X      fprintf (fp, "Summary: \n");
  1383. X      fprintf (fp, "Keywords: \n\n\n");
  1384. X***************
  1385. X*** 505,511 ****
  1386. X          switch (ch) {
  1387. X          case 'e':
  1388. X              invoke_editor (article);
  1389. X!             while (! post_header_ok(article)) {
  1390. X                  do {
  1391. X                      sprintf (msg, "%s%c", txt_no_blank_line, 'e');
  1392. X                      wait_message (msg);
  1393. X--- 506,512 ----
  1394. X          switch (ch) {
  1395. X          case 'e':
  1396. X              invoke_editor (article);
  1397. X!             while (! post_header_ok (article)) {
  1398. X                  do {
  1399. X                      sprintf (msg, "%s%c", txt_no_blank_line, 'e');
  1400. X                      wait_message (msg);
  1401. X***************
  1402. X*** 602,608 ****
  1403. X          }
  1404. X          *note_h_followup = '\0';
  1405. X          find_reply_to_addr (respnum, buf);
  1406. X!         mail_to_someone (buf, TRUE, FALSE, &ret_code);
  1407. X          return (ret_code);
  1408. X      } else if (*note_h_followup && strcmp (note_h_followup, group) != 0) {
  1409. X          MoveCursor (LINES/2, 0);
  1410. X--- 603,609 ----
  1411. X          }
  1412. X          *note_h_followup = '\0';
  1413. X          find_reply_to_addr (respnum, buf);
  1414. X!         mail_to_someone (respnum, buf, TRUE, FALSE, &ret_code);
  1415. X          return (ret_code);
  1416. X      } else if (*note_h_followup && strcmp (note_h_followup, group) != 0) {
  1417. X          MoveCursor (LINES/2, 0);
  1418. X***************
  1419. X*** 633,638 ****
  1420. X--- 634,641 ----
  1421. X      }
  1422. X      chmod (article, 0600);
  1423. X  
  1424. X+     i = find_group_index (group);
  1425. X+ 
  1426. X      fprintf (fp, "Subject: Re: %s\n", eat_re (note_h_subj));
  1427. X  
  1428. X      if (*note_h_followup && strcmp (note_h_followup, "poster") != 0) {
  1429. X***************
  1430. X*** 639,655 ****
  1431. X          fprintf (fp, "Newsgroups: %s\n", note_h_followup);
  1432. X      } else {
  1433. X          fprintf (fp, "Newsgroups: %s\n", note_h_newsgroups);
  1434. X      }
  1435. X  
  1436. X-     i = find_group_index (group);
  1437. X-     if (i >= 0 && active[i].attribute.followup_to != (char *) 0) {
  1438. X-         fprintf (fp, "Followup-To: %s\n", active[i].attribute.followup_to);
  1439. X-     }
  1440. X-     
  1441. X      fprintf (fp, "References: %s\n", note_h_messageid);
  1442. X  
  1443. X!     if (*my_org) {
  1444. X!         fprintf (fp, "Organization: %s\n", my_org);
  1445. X          start_line_offset++;
  1446. X      }
  1447. X      if (*reply_to) {
  1448. X--- 642,665 ----
  1449. X          fprintf (fp, "Newsgroups: %s\n", note_h_followup);
  1450. X      } else {
  1451. X          fprintf (fp, "Newsgroups: %s\n", note_h_newsgroups);
  1452. X+         if (i >= 0 && active[i].attribute.followup_to != (char *) 0) {
  1453. X+             fprintf (fp, "Followup-To: %s\n", 
  1454. X+                 active[i].attribute.followup_to);
  1455. X+             start_line_offset++;
  1456. X+         } else {
  1457. X+             ptr = (char *) strchr (note_h_newsgroups, ',');
  1458. X+             if (ptr) {
  1459. X+                 fprintf (fp, "Followup-To: %s\n", 
  1460. X+                     note_h_newsgroups);
  1461. X+                 start_line_offset++;
  1462. X+             }
  1463. X+         }
  1464. X      }
  1465. X  
  1466. X      fprintf (fp, "References: %s\n", note_h_messageid);
  1467. X  
  1468. X!     if (i >= 0 && active[i].attribute.organization != (char *) 0) {
  1469. X!         fprintf (fp, "Organization: %s\n", active[i].attribute.organization);
  1470. X          start_line_offset++;
  1471. X      }
  1472. X      if (*reply_to) {
  1473. X***************
  1474. X*** 662,674 ****
  1475. X      }
  1476. X      fprintf (fp, "\n");
  1477. X  
  1478. X!     if (copy_text) {    /* if "copy_text" */
  1479. X!         if (arts[respnum].from != (char *) 0) {     
  1480. X!             if (arts[respnum].name == arts[respnum].from) {     
  1481. X!                 fprintf (fp, txt_writes, arts[respnum].from);
  1482. X!             } else {
  1483. X!                 fprintf (fp, txt_writes_name, arts[respnum].name, arts[respnum].from);
  1484. X!             }
  1485. X          }
  1486. X          fseek (note_fp, note_mark[0], 0);
  1487. X          copy_fp (note_fp, fp, quote_chars);
  1488. X--- 672,680 ----
  1489. X      }
  1490. X      fprintf (fp, "\n");
  1491. X  
  1492. X!     if (copy_text) {
  1493. X!         if (strfquote (group, respnum, buf, sizeof (buf), news_quote_format)) {
  1494. X!             fprintf (fp, "%s\n", buf);
  1495. X          }
  1496. X          fseek (note_fp, note_mark[0], 0);
  1497. X          copy_fp (note_fp, fp, quote_chars);
  1498. X***************
  1499. X*** 758,764 ****
  1500. X  }
  1501. X  
  1502. X  
  1503. X! int mail_to_someone (address, mail_to_poster, confirm_to_mail, mailed_ok)
  1504. X      char *address;
  1505. X      int mail_to_poster;
  1506. X      int confirm_to_mail;
  1507. X--- 764,771 ----
  1508. X  }
  1509. X  
  1510. X  
  1511. X! int mail_to_someone (respnum, address, mail_to_poster, confirm_to_mail, mailed_ok)
  1512. X!     int respnum;
  1513. X      char *address;
  1514. X      int mail_to_poster;
  1515. X      int confirm_to_mail;
  1516. X***************
  1517. X*** 797,804 ****
  1518. X      } else {
  1519. X          fprintf (fp, "Newsgroups: %s\n", note_h_newsgroups);
  1520. X      }
  1521. X!     if (*my_org) {
  1522. X!         fprintf (fp, "Organization: %s\n", my_org);
  1523. X          start_line_offset++;
  1524. X      }
  1525. X      if (*reply_to) {
  1526. X--- 804,811 ----
  1527. X      } else {
  1528. X          fprintf (fp, "Newsgroups: %s\n", note_h_newsgroups);
  1529. X      }
  1530. X!     if (*default_organization) {
  1531. X!         fprintf (fp, "Organization: %s\n", default_organization);
  1532. X          start_line_offset++;
  1533. X      }
  1534. X      if (*reply_to) {
  1535. X***************
  1536. X*** 809,815 ****
  1537. X      
  1538. X      if (mail_to_poster) {
  1539. X          ch = 'e';
  1540. X!         fprintf (fp, "In article %s you wrote:\n", note_h_messageid);
  1541. X          fseek (note_fp, note_mark[0], 0);
  1542. X          copy_fp (note_fp, fp, quote_chars);
  1543. X      } else {
  1544. X--- 816,825 ----
  1545. X      
  1546. X      if (mail_to_poster) {
  1547. X          ch = 'e';
  1548. X!         if (strfquote (active[my_group[cur_groupnum]].name, 
  1549. X!             respnum, buf, sizeof (buf), mail_quote_format)) {
  1550. X!             fprintf (fp, "%s\n", buf);
  1551. X!         }
  1552. X          fseek (note_fp, note_mark[0], 0);
  1553. X          copy_fp (note_fp, fp, quote_chars);
  1554. X      } else {
  1555. X***************
  1556. X*** 824,830 ****
  1557. X          if (confirm_to_mail) {
  1558. X              do {
  1559. X                  sprintf (msg, "%s [%.*s]: %c", txt_quit_edit_send, 
  1560. X!                     COLS-30, note_h_subj, ch_default);
  1561. X                  wait_message (msg);
  1562. X                  MoveCursor (LINES, (int) (strlen (msg)-1));
  1563. X                  if ((ch = (char) ReadCh ()) == CR)
  1564. X--- 834,840 ----
  1565. X          if (confirm_to_mail) {
  1566. X              do {
  1567. X                  sprintf (msg, "%s [%.*s]: %c", txt_quit_edit_send, 
  1568. X!                     COLS-36, note_h_subj, ch_default);
  1569. X                  wait_message (msg);
  1570. X                  MoveCursor (LINES, (int) (strlen (msg)-1));
  1571. X                  if ((ch = (char) ReadCh ()) == CR)
  1572. X***************
  1573. X*** 846,853 ****
  1574. X  
  1575. X              case 's':
  1576. X                  /*
  1577. X!                  *  Open letter and get the To: line in case they changed
  1578. X!                  *  it with the editor
  1579. X                   */
  1580. X                  find_mail_header (HEADER_TO, nam, mail_to);
  1581. X                  sprintf (msg, txt_mailing_to, mail_to);
  1582. X--- 856,863 ----
  1583. X  
  1584. X              case 's':
  1585. X                  /*
  1586. X!                  *  Open letter and get the To: line in case 
  1587. X!                  *  they changed it with the editor
  1588. X                   */
  1589. X                  find_mail_header (HEADER_TO, nam, mail_to);
  1590. X                  sprintf (msg, txt_mailing_to, mail_to);
  1591. X***************
  1592. X*** 868,874 ****
  1593. X          if (mail_to_poster) {
  1594. X              do {
  1595. X                  sprintf (msg, "%s [Re: %.*s]: %c", txt_quit_edit_send, 
  1596. X!                     COLS-34, eat_re (note_h_subj), ch_default);
  1597. X                  wait_message (msg);
  1598. X                  MoveCursor (LINES, (int) (strlen (msg)-1));
  1599. X                  if ((ch = (char) ReadCh ()) == CR)
  1600. X--- 878,884 ----
  1601. X          if (mail_to_poster) {
  1602. X              do {
  1603. X                  sprintf (msg, "%s [Re: %.*s]: %c", txt_quit_edit_send, 
  1604. X!                     COLS-36, eat_re (note_h_subj), ch_default);
  1605. X                  wait_message (msg);
  1606. X                  MoveCursor (LINES, (int) (strlen (msg)-1));
  1607. X                  if ((ch = (char) ReadCh ()) == CR)
  1608. X***************
  1609. X*** 886,901 ****
  1610. X  
  1611. X  int mail_bug_report ()
  1612. X  {
  1613. X!     char nam[100];
  1614. X!     char ch;
  1615. X!     char ch_default = 's';
  1616. X!     char buf[LEN];
  1617. X      char mail_to[PATH_LEN];
  1618. X      FILE *fp;
  1619. X      FILE *fp_uname;
  1620. X      int is_nntp = FALSE;
  1621. X!     int is_nntp_only   = FALSE;
  1622. X!     int is_longfiles   = FALSE;
  1623. X      int uname_ok = FALSE;
  1624. X  
  1625. X      start_line_offset = 5;
  1626. X--- 896,912 ----
  1627. X  
  1628. X  int mail_bug_report ()
  1629. X  {
  1630. X!     char buf[LEN], nam[100];
  1631. X!     char *gateway = (char *) 0;
  1632. X!     char *domain = (char *) 0;
  1633. X!     char ch, ch_default = 's';
  1634. X      char mail_to[PATH_LEN];
  1635. X      FILE *fp;
  1636. X      FILE *fp_uname;
  1637. X+     int is_debug = FALSE;
  1638. X+     int is_longfiles = FALSE;
  1639. X      int is_nntp = FALSE;
  1640. X!     int is_nntp_only = FALSE;
  1641. X      int uname_ok = FALSE;
  1642. X  
  1643. X      start_line_offset = 5;
  1644. X***************
  1645. X*** 910,919 ****
  1646. X      chmod(nam, 0600);
  1647. X  
  1648. X      fprintf (fp, "To: %s%s\n", bug_addr, add_addr);
  1649. X!     fprintf (fp, "Subject: BUG REPORT %s %s PL%d\n",
  1650. X!         progname, VERSION, PATCHLEVEL);
  1651. X!     if (*my_org) {
  1652. X!         fprintf (fp, "Organization: %s\n", my_org);
  1653. X          start_line_offset++;
  1654. X      }
  1655. X      if (*reply_to) {
  1656. X--- 921,929 ----
  1657. X      chmod(nam, 0600);
  1658. X  
  1659. X      fprintf (fp, "To: %s%s\n", bug_addr, add_addr);
  1660. X!     fprintf (fp, "Subject: BUG REPORT tin %s PL%d\n", VERSION, PATCHLEVEL);
  1661. X!     if (*default_organization) {
  1662. X!         fprintf (fp, "Organization: %s\n", default_organization);
  1663. X          start_line_offset++;
  1664. X      }
  1665. X      if (*reply_to) {
  1666. X***************
  1667. X*** 945,957 ****
  1668. X  #ifdef NNTP_ONLY
  1669. X      is_nntp_only = TRUE;
  1670. X  #endif
  1671. X!     fprintf (fp, "\nCFG1: active=%d  arts=%d  reread=%d  longfilenames=%d  setuid=%d\n\
  1672. X! CFG2: nntp=%d  nntp_only=%d  nntp_xuser=%d  nntp_xindex=%d  nntp_xspooldir=%d\n",
  1673. X!         DEFAULT_ACTIVE_NUM,DEFAULT_ARTICLE_NUM,reread_active_file_secs,
  1674. X!         is_longfiles, (tin_uid == real_uid ? 0 : 1), is_nntp, 
  1675. X!         is_nntp_only,  xuser_supported, xindex_supported, 
  1676. X          xspooldir_supported);
  1677. X!     start_line_offset += 2;
  1678. X      
  1679. X      fprintf (fp, "\nPlease enter bug report/gripe/comment:\n");
  1680. X  
  1681. X--- 955,987 ----
  1682. X  #ifdef NNTP_ONLY
  1683. X      is_nntp_only = TRUE;
  1684. X  #endif
  1685. X! #ifdef DEBUG
  1686. X!     is_debug = TRUE;
  1687. X! #endif
  1688. X! #ifdef NNTP_INEWS_GATEWAY
  1689. X!     gateway = NNTP_INEWS_GATEWAY;
  1690. X! #endif
  1691. X! #ifdef NNTP_INEWS_DOMAIN
  1692. X!     domain = NNTP_INEWS_DOMAIN;
  1693. X! #endif
  1694. X!     fprintf (fp, "\nCFG1: active=%d  arts=%d  reread=%d  longfilenames=%d  setuid=%d\n",
  1695. X!         DEFAULT_ACTIVE_NUM, 
  1696. X!         DEFAULT_ARTICLE_NUM, 
  1697. X!         reread_active_file_secs,
  1698. X!         is_longfiles, 
  1699. X!         (tin_uid == real_uid ? 0 : 1));
  1700. X!     fprintf (fp, "CFG2: nntp=%d  nntp_only=%d  nntp_xuser=%d  nntp_xindex=%d  nntp_xspooldir=%d\n",
  1701. X!         is_nntp, 
  1702. X!         is_nntp_only,  
  1703. X!         xuser_supported, 
  1704. X!         xindex_supported, 
  1705. X          xspooldir_supported);
  1706. X!     fprintf (fp, "CFG3: debug=%d gateway=[%s] domain=[%s]\n",
  1707. X!         is_debug,
  1708. X!         (gateway ? gateway : ""),
  1709. X!         (domain ? domain : ""));
  1710. X! 
  1711. X!     start_line_offset += 3;
  1712. X      
  1713. X      fprintf (fp, "\nPlease enter bug report/gripe/comment:\n");
  1714. X  
  1715. X***************
  1716. X*** 974,980 ****
  1717. X              return TRUE;
  1718. X          case 's':
  1719. X              sprintf (msg, txt_mail_bug_report_confirm, bug_addr, add_addr);
  1720. X!             if (prompt_yn (LINES, msg, 'y')) {
  1721. X                  strcpy (mail_to, bug_addr);
  1722. X                  find_mail_header (HEADER_TO, nam, mail_to);
  1723. X                  sprintf (msg, txt_mailing_to, mail_to);
  1724. X--- 1004,1010 ----
  1725. X              return TRUE;
  1726. X          case 's':
  1727. X              sprintf (msg, txt_mail_bug_report_confirm, bug_addr, add_addr);
  1728. X!             if (prompt_yn (LINES, msg, 'n')) {
  1729. X                  strcpy (mail_to, bug_addr);
  1730. X                  find_mail_header (HEADER_TO, nam, mail_to);
  1731. X                  sprintf (msg, txt_mailing_to, mail_to);
  1732. X***************
  1733. X*** 1042,1049 ****
  1734. X      fprintf (fp, "To: %s\n", from_addr);
  1735. X      fprintf (fp, "Subject: Re: %s\n", eat_re(note_h_subj) );
  1736. X      fprintf (fp, "Newsgroups: %s\n", note_h_newsgroups);
  1737. X!     if (*my_org) {
  1738. X!         fprintf (fp, "Organization: %s\n", my_org);
  1739. X          start_line_offset++;
  1740. X      }
  1741. X      if (*reply_to) {
  1742. X--- 1072,1079 ----
  1743. X      fprintf (fp, "To: %s\n", from_addr);
  1744. X      fprintf (fp, "Subject: Re: %s\n", eat_re(note_h_subj) );
  1745. X      fprintf (fp, "Newsgroups: %s\n", note_h_newsgroups);
  1746. X!     if (*default_organization) {
  1747. X!         fprintf (fp, "Organization: %s\n", default_organization);
  1748. X          start_line_offset++;
  1749. X      }
  1750. X      if (*reply_to) {
  1751. X***************
  1752. X*** 1052,1059 ****
  1753. X      }
  1754. X      fputc ('\n', fp);
  1755. X  
  1756. X!     if (copy_text) {        /* if "copy_text" */
  1757. X!         fprintf (fp, txt_in_art_you_write, note_h_messageid);
  1758. X          fseek (note_fp, note_mark[0], 0);
  1759. X          copy_fp (note_fp, fp, quote_chars);
  1760. X      }
  1761. X--- 1082,1091 ----
  1762. X      }
  1763. X      fputc ('\n', fp);
  1764. X  
  1765. X!     if (copy_text) {
  1766. X!         if (strfquote (group, respnum, buf, sizeof (buf), mail_quote_format)) {
  1767. X!             fprintf (fp, "%s\n", buf);
  1768. X!         }
  1769. X          fseek (note_fp, note_mark[0], 0);
  1770. X          copy_fp (note_fp, fp, quote_chars);
  1771. X      }
  1772. X***************
  1773. X*** 1080,1085 ****
  1774. X--- 1112,1118 ----
  1775. X              find_mail_header (HEADER_TO, nam, mail_to);
  1776. X              sprintf (msg, txt_mailing_to, mail_to);
  1777. X              wait_message (msg);
  1778. X+             insert_x_headers (nam);
  1779. X  #ifdef AMIGA
  1780. X              sprintf (buf, "%s <%s -f %s", mailer, nam, userid);
  1781. X  #else
  1782. X***************
  1783. X*** 1150,1158 ****
  1784. X                      my_strncpy (buf2, &buf[4], sizeof (buf2));
  1785. X                      yank_to_addr (buf2, new_value);
  1786. X                      found = TRUE;
  1787. X!                 } 
  1788. X                  break;
  1789. X- 
  1790. X              case HEADER_NEWSGROUPS:
  1791. X                  if (match_string (buf, "Newsgroups: ", new_value, sizeof (new_value))) {
  1792. X                      found = TRUE;
  1793. X--- 1183,1190 ----
  1794. X                      my_strncpy (buf2, &buf[4], sizeof (buf2));
  1795. X                      yank_to_addr (buf2, new_value);
  1796. X                      found = TRUE;
  1797. X!                 }
  1798. X                  break;
  1799. X              case HEADER_NEWSGROUPS:
  1800. X                  if (match_string (buf, "Newsgroups: ", new_value, sizeof (new_value))) {
  1801. X                      found = TRUE;
  1802. X***************
  1803. X*** 1177,1194 ****
  1804. X  }
  1805. X  
  1806. X  
  1807. X! int cancel_article (group, respnum)
  1808. X      char *group;
  1809. X      int respnum;
  1810. X  {
  1811. X!     char ch, ch_default = 'c';
  1812. X      char buf[LEN];
  1813. X!     char cancel[PATH_LEN];
  1814. X      char host_name[PATH_LEN];
  1815. X      char user_name[128];
  1816. X      char full_name[128];
  1817. X      char from[PATH_LEN];
  1818. X      FILE *fp;
  1819. X      int redraw_screen = FALSE;
  1820. X  
  1821. X      /*
  1822. X--- 1209,1227 ----
  1823. X  }
  1824. X  
  1825. X  
  1826. X! int delete_article (group, respnum)
  1827. X      char *group;
  1828. X      int respnum;
  1829. X  {
  1830. X!     char ch, ch_default = 'd';
  1831. X      char buf[LEN];
  1832. X!     char delete[PATH_LEN];
  1833. X      char host_name[PATH_LEN];
  1834. X      char user_name[128];
  1835. X      char full_name[128];
  1836. X      char from[PATH_LEN];
  1837. X      FILE *fp;
  1838. X+     int i;
  1839. X      int redraw_screen = FALSE;
  1840. X  
  1841. X      /*
  1842. X***************
  1843. X*** 1199,1209 ****
  1844. X          return (redraw_screen);
  1845. X      }
  1846. X  
  1847. X      start_line_offset = 4;
  1848. X  
  1849. X      get_host_name (host_name);
  1850. X      get_user_info (user_name, full_name);
  1851. X!     get_from_name (user_name, host_name, full_name, cancel);
  1852. X  
  1853. X      if (arts[respnum].from != arts[respnum].name) {
  1854. X          sprintf (from, "%s (%s)", arts[respnum].from, arts[respnum].name);
  1855. X--- 1232,1262 ----
  1856. X          return (redraw_screen);
  1857. X      }
  1858. X  
  1859. X+     /*
  1860. X+      * Check if news / mail group
  1861. X+      */
  1862. X+     i = find_group_index (group);
  1863. X+     if (i == -1) {
  1864. X+         clear_message ();
  1865. X+         return (redraw_screen); 
  1866. X+     }
  1867. X+     if (active[i].type == GROUP_TYPE_MAIL) {
  1868. X+         make_group_path (group, buf);
  1869. X+         sprintf (delete, "%s/%s/%ld", active[i].spooldir, buf, respnum);
  1870. X+         sprintf (buf, "Delete article [%s]? (y/n): ", delete);
  1871. X+         if (prompt_yn (LINES, buf, 'y')) {
  1872. X+             unlink (delete);
  1873. X+             return TRUE;
  1874. X+         } else {
  1875. X+             return (redraw_screen); 
  1876. X+         }
  1877. X+     }
  1878. X+          
  1879. X      start_line_offset = 4;
  1880. X  
  1881. X      get_host_name (host_name);
  1882. X      get_user_info (user_name, full_name);
  1883. X!     get_from_name (user_name, host_name, full_name, delete);
  1884. X  
  1885. X      if (arts[respnum].from != arts[respnum].name) {
  1886. X          sprintf (from, "%s (%s)", arts[respnum].from, arts[respnum].name);
  1887. X***************
  1888. X*** 1212,1234 ****
  1889. X      }
  1890. X  
  1891. X      if (debug == 2) {
  1892. X!         sprintf (msg, "From=[%s]  Cancel=[%s]", from, cancel);        
  1893. X          error_message (msg, "");
  1894. X      }
  1895. X      
  1896. X!     if (strcmp (from, cancel) != 0) {
  1897. X!         info_message (txt_art_cannot_cancel);
  1898. X          return (redraw_screen);
  1899. X      }
  1900. X              
  1901. X      clear_message ();
  1902. X      
  1903. X!     joinpath (cancel, homedir, ".cancel");
  1904. X!     if ((fp = fopen (cancel, "w")) == NULL) {
  1905. X!         perror_message (txt_cannot_open, cancel);
  1906. X          return (redraw_screen);
  1907. X      }
  1908. X!     chmod (cancel, 0600);
  1909. X  
  1910. X      fprintf (fp, "Subject: cancel %s\n", note_h_messageid);
  1911. X      if (*note_h_followup) {
  1912. X--- 1265,1287 ----
  1913. X      }
  1914. X  
  1915. X      if (debug == 2) {
  1916. X!         sprintf (msg, "From=[%s]  Cancel=[%s]", from, delete);        
  1917. X          error_message (msg, "");
  1918. X      }
  1919. X      
  1920. X!     if (strcmp (from, delete) != 0) {
  1921. X!         info_message (txt_art_cannot_delete);
  1922. X          return (redraw_screen);
  1923. X      }
  1924. X              
  1925. X      clear_message ();
  1926. X      
  1927. X!     joinpath (delete, homedir, ".cancel");
  1928. X!     if ((fp = fopen (delete, "w")) == NULL) {
  1929. X!         perror_message (txt_cannot_open, delete);
  1930. X          return (redraw_screen);
  1931. X      }
  1932. X!     chmod (delete, 0600);
  1933. X  
  1934. X      fprintf (fp, "Subject: cancel %s\n", note_h_messageid);
  1935. X      if (*note_h_followup) {
  1936. X***************
  1937. X*** 1237,1244 ****
  1938. X          fprintf (fp, "Newsgroups: %s\n", note_h_newsgroups);
  1939. X      }
  1940. X      fprintf (fp, "Control: cancel %s\n", note_h_messageid);
  1941. X!     if (*my_org) { 
  1942. X!         fprintf (fp, "Organization: %s\n", my_org);
  1943. X          start_line_offset++;    
  1944. X      }
  1945. X      if (*reply_to) {
  1946. X--- 1290,1297 ----
  1947. X          fprintf (fp, "Newsgroups: %s\n", note_h_newsgroups);
  1948. X      }
  1949. X      fprintf (fp, "Control: cancel %s\n", note_h_messageid);
  1950. X!     if (*default_organization) { 
  1951. X!         fprintf (fp, "Organization: %s\n", default_organization);
  1952. X          start_line_offset++;    
  1953. X      }
  1954. X      if (*reply_to) {
  1955. X***************
  1956. X*** 1245,1253 ****
  1957. X          fprintf (fp, "Reply-To: %s\n", reply_to);
  1958. X          start_line_offset++;    
  1959. X      }
  1960. X      fputc ('\n', fp);
  1961. X  
  1962. X!     fprintf (fp, "Article cancelled from within tin v%s PL%d\n",
  1963. X          VERSION, PATCHLEVEL);
  1964. X      
  1965. X      fclose (fp);
  1966. X--- 1298,1310 ----
  1967. X          fprintf (fp, "Reply-To: %s\n", reply_to);
  1968. X          start_line_offset++;    
  1969. X      }
  1970. X+     if (*note_h_distrib) {
  1971. X+         fprintf (fp, "Distribution: %s\n", note_h_distrib);
  1972. X+         start_line_offset++;    
  1973. X+     }
  1974. X      fputc ('\n', fp);
  1975. X  
  1976. X!     fprintf (fp, "Article cancelled from within tin [v%s PL%d]\n",
  1977. X          VERSION, PATCHLEVEL);
  1978. X      
  1979. X      fclose (fp);
  1980. X***************
  1981. X*** 1254,1295 ****
  1982. X      
  1983. X      while (1) {
  1984. X          do {
  1985. X!             sprintf (msg, "%s [%.*s]: %c", txt_quit_edit_cancel,
  1986. X                  COLS-30, note_h_subj, ch_default);
  1987. X              wait_message (msg);
  1988. X              MoveCursor (LINES, (int) strlen (msg)-1);
  1989. X              if ((ch = (char) ReadCh ()) == CR)
  1990. X                  ch = ch_default;
  1991. X!         } while (! strchr ("ceq\033", ch));
  1992. X  
  1993. X          switch (ch) {
  1994. X          case 'e':
  1995. X!             invoke_editor (cancel);
  1996. X              redraw_screen = TRUE;
  1997. X              break;
  1998. X  
  1999. X          case 'q':
  2000. X          case ESC:
  2001. X!             unlink (cancel);
  2002. X              clear_message ();
  2003. X              return (redraw_screen);
  2004. X  
  2005. X!         case 'c':
  2006. X!             wait_message (txt_cancelling);
  2007. X!             if (submit_file (cancel)) {
  2008. X!                 info_message (txt_art_cancelled);
  2009. X!                 goto cancel_article_done;
  2010. X              } else {
  2011. X!                 error_message (txt_command_failed_s, cancel);
  2012. X                  break;
  2013. X              }
  2014. X          }
  2015. X      }
  2016. X  
  2017. X! cancel_article_done:
  2018. X!     find_mail_header (HEADER_SUBJECT, cancel, buf);
  2019. X!     unlink (cancel);
  2020. X!     update_art_posted_file (group, 'c', buf);
  2021. X  
  2022. X      return (redraw_screen);
  2023. X  }
  2024. X--- 1311,1352 ----
  2025. X      
  2026. X      while (1) {
  2027. X          do {
  2028. X!             sprintf (msg, "%s [%.*s]: %c", txt_quit_edit_delete,
  2029. X                  COLS-30, note_h_subj, ch_default);
  2030. X              wait_message (msg);
  2031. X              MoveCursor (LINES, (int) strlen (msg)-1);
  2032. X              if ((ch = (char) ReadCh ()) == CR)
  2033. X                  ch = ch_default;
  2034. X!         } while (! strchr ("deq\033", ch));
  2035. X  
  2036. X          switch (ch) {
  2037. X          case 'e':
  2038. X!             invoke_editor (delete);
  2039. X              redraw_screen = TRUE;
  2040. X              break;
  2041. X  
  2042. X          case 'q':
  2043. X          case ESC:
  2044. X!             unlink (delete);
  2045. X              clear_message ();
  2046. X              return (redraw_screen);
  2047. X  
  2048. X!         case 'd':
  2049. X!             wait_message (txt_deleting_art);
  2050. X!             if (submit_file (delete)) {
  2051. X!                 info_message (txt_art_deleted);
  2052. X!                 goto delete_article_done;
  2053. X              } else {
  2054. X!                 error_message (txt_command_failed_s, delete);
  2055. X                  break;
  2056. X              }
  2057. X          }
  2058. X      }
  2059. X  
  2060. X! delete_article_done:
  2061. X!     find_mail_header (HEADER_SUBJECT, delete, buf);
  2062. X!     unlink (delete);
  2063. X!     update_art_posted_file (group, 'd', buf);
  2064. X  
  2065. X      return (redraw_screen);
  2066. X  }
  2067. X***************
  2068. X*** 1306,1312 ****
  2069. X      char ch;
  2070. X      char ch_default = 'p';
  2071. X      FILE *fp;
  2072. X!     int ret_code = POSTED_NONE;
  2073. X      
  2074. X      start_line_offset = 4;
  2075. X  
  2076. X--- 1363,1369 ----
  2077. X      char ch;
  2078. X      char ch_default = 'p';
  2079. X      FILE *fp;
  2080. X!     int i, ret_code = POSTED_NONE;
  2081. X      
  2082. X      start_line_offset = 4;
  2083. X  
  2084. X***************
  2085. X*** 1319,1326 ****
  2086. X      fprintf (fp, "Subject: %s\n", eat_re (note_h_subj));
  2087. X      fprintf (fp, "Newsgroups: %s\n", group);
  2088. X  
  2089. X!     if (*my_org) {
  2090. X!         fprintf (fp, "Organization: %s\n", my_org);
  2091. X          start_line_offset++;
  2092. X      }
  2093. X      if (*reply_to) {
  2094. X--- 1376,1384 ----
  2095. X      fprintf (fp, "Subject: %s\n", eat_re (note_h_subj));
  2096. X      fprintf (fp, "Newsgroups: %s\n", group);
  2097. X  
  2098. X!     i = find_group_index (group);
  2099. X!     if (i >= 0 && active[i].attribute.organization != (char *) 0) {
  2100. X!         fprintf (fp, "Organization: %s\n", active[i].attribute.organization);
  2101. X          start_line_offset++;
  2102. X      }
  2103. X      if (*reply_to) {
  2104. X***************
  2105. X*** 1403,1409 ****
  2106. X  
  2107. X      insert_x_headers (name);
  2108. X  
  2109. X!     if (read_news_via_nntp) {
  2110. X  #ifdef DEBUG
  2111. X          if (debug == 2) {
  2112. X              wait_message ("Using BUILTIN inews");
  2113. X--- 1461,1467 ----
  2114. X  
  2115. X      insert_x_headers (name);
  2116. X  
  2117. X!     if (read_news_via_nntp && use_builtin_inews) {
  2118. X  #ifdef DEBUG
  2119. X          if (debug == 2) {
  2120. X              wait_message ("Using BUILTIN inews");
  2121. X***************
  2122. X*** 1437,1474 ****
  2123. X  }
  2124. X  
  2125. X  
  2126. X- void add_signature (fp, flag)
  2127. X-     FILE *fp;
  2128. X-     int flag;
  2129. X- {
  2130. X-     FILE *sigfp;
  2131. X- 
  2132. X- #ifdef NNTP_INEWS
  2133. X-     if (read_news_via_nntp) {
  2134. X-         flag = TRUE;
  2135. X-     }
  2136. X- #endif
  2137. X- 
  2138. X-     /*
  2139. X-      * Use ~/.signature or ~/.Sig or custom .Sig files
  2140. X-      */
  2141. X-     if ((sigfp = fopen (default_signature, "r")) != NULL) {
  2142. X-         if (flag) {
  2143. X-             fprintf (fp, "\n--\n");
  2144. X-             copy_fp (sigfp, fp, "");
  2145. X-         }
  2146. X-         fclose (sigfp);
  2147. X-         return;
  2148. X-     }
  2149. X- 
  2150. X-     if ((sigfp = fopen (active[my_group[cur_groupnum]].attribute.sigfile, "r")) != NULL) {
  2151. X-         fprintf (fp, "\n--\n");
  2152. X-         copy_fp (sigfp, fp, "");
  2153. X-         fclose (sigfp);
  2154. X-     }
  2155. X- }
  2156. X- 
  2157. X- 
  2158. X  void insert_x_headers (infile)
  2159. X      char *infile;
  2160. X  {
  2161. X--- 1495,1500 ----
  2162. X***************
  2163. X*** 1482,1489 ****
  2164. X          if ((fp_out = fopen (outfile, "w")) != NULL) {
  2165. X              while (fgets (line, sizeof (line), fp_in) != NULL) {
  2166. X                  if (! gotit && line[0] == '\n') {
  2167. X!                     fprintf (fp_out, "X-Newsreader: TIN [version %s PL%d]\n\n",
  2168. X!                         VERSION, PATCHLEVEL);
  2169. X                      gotit = TRUE;
  2170. X                  } else {
  2171. X                      fputs (line, fp_out); 
  2172. X--- 1508,1520 ----
  2173. X          if ((fp_out = fopen (outfile, "w")) != NULL) {
  2174. X              while (fgets (line, sizeof (line), fp_in) != NULL) {
  2175. X                  if (! gotit && line[0] == '\n') {
  2176. X!                     if (active[my_group[cur_groupnum]].type == GROUP_TYPE_MAIL) {
  2177. X!                         fprintf (fp_out, "X-Mailer: TIN [version %s PL%d]\n\n",
  2178. X!                             VERSION, PATCHLEVEL);
  2179. X!                     } else {
  2180. X!                         fprintf (fp_out, "X-Newsreader: TIN [version %s PL%d]\n\n",
  2181. X!                             VERSION, PATCHLEVEL);
  2182. X!                     }
  2183. X                      gotit = TRUE;
  2184. X                  } else {
  2185. X                      fputs (line, fp_out); 
  2186. Xdiff -rcs ../1.16/prompt.c ./prompt.c
  2187. X*** ../1.16/prompt.c    Sun Nov 15 18:42:02 1992
  2188. X--- ./prompt.c    Sun Nov 15 16:02:48 1992
  2189. X***************
  2190. X*** 139,145 ****
  2191. X  
  2192. X      set_alarm_clock_on ();
  2193. X  
  2194. X!     return (ch == 'y' ? TRUE : FALSE);
  2195. X  }
  2196. X  
  2197. X  
  2198. X--- 139,145 ----
  2199. X  
  2200. X      set_alarm_clock_on ();
  2201. X  
  2202. X!     return (ch == 'y' || ch == 'Y' ? TRUE : FALSE);
  2203. X  }
  2204. X  
  2205. X  
  2206. Xdiff -rcs ../1.16/proto.h ./proto.h
  2207. X*** ../1.16/proto.h    Sun Nov 15 18:41:42 1992
  2208. X--- ./proto.h    Sun Nov 15 16:02:48 1992
  2209. X***************
  2210. X*** 3,9 ****
  2211. X  /* active.c */
  2212. X  extern void resync_active_file(void);
  2213. X  extern int find_group_index(char *group);
  2214. X! extern void read_active_file(void);
  2215. X  extern void backup_active(int create);
  2216. X  extern void check_for_any_new_groups(void);
  2217. X  extern int prompt_subscribe_group(char *group);
  2218. X--- 3,10 ----
  2219. X  /* active.c */
  2220. X  extern void resync_active_file(void);
  2221. X  extern int find_group_index(char *group);
  2222. X! extern int parse_active_line(char *line, long *max, long *min, char *moderated);
  2223. X! extern void read_news_active_file(void);
  2224. X  extern void backup_active(int create);
  2225. X  extern void check_for_any_new_groups(void);
  2226. X  extern int prompt_subscribe_group(char *group);
  2227. X***************
  2228. X*** 10,33 ****
  2229. X  extern void set_default_attributes(void);
  2230. X  extern void read_attributes_file(void);
  2231. X  extern void write_attributes_file(void);
  2232. X- extern void read_newsgroups_file(void);
  2233. X  extern void read_active_times_file(void);
  2234. X  extern void write_active_times_file(void);
  2235. X  extern void load_active_size_info(char *info);
  2236. X  extern int find_active_size_index(char *cur_active_server);
  2237. X  /* amiga.c */
  2238. X  /* art.c */
  2239. X  extern void find_base(int index);
  2240. X  extern int num_of_arts(void);
  2241. X  extern int valid_artnum(long art);
  2242. X! extern int purge_needed(void);
  2243. X! extern void index_group(char *group, char *group_path);
  2244. X  extern int read_group(char *group, char *group_path);
  2245. X  extern void make_threads(int rethread);
  2246. X  extern int parse_headers(FILE *fp, struct article_t *h);
  2247. X  extern void write_index_file(char *group);
  2248. X! extern int read_index_file(char *group_name);
  2249. X! extern void find_index_file(char *group);
  2250. X  extern void do_update(void);
  2251. X  extern int artnum_comp(char *p1, char *p2);
  2252. X  extern int subj_comp(char *p1, char *p2);
  2253. X--- 11,34 ----
  2254. X  extern void set_default_attributes(void);
  2255. X  extern void read_attributes_file(void);
  2256. X  extern void write_attributes_file(void);
  2257. X  extern void read_active_times_file(void);
  2258. X  extern void write_active_times_file(void);
  2259. X  extern void load_active_size_info(char *info);
  2260. X  extern int find_active_size_index(char *cur_active_server);
  2261. X+ extern void read_motd_file(void);
  2262. X  /* amiga.c */
  2263. X  /* art.c */
  2264. X  extern void find_base(int index);
  2265. X  extern int num_of_arts(void);
  2266. X  extern int valid_artnum(long art);
  2267. X! extern int purge_needed(char *group_path);
  2268. X! extern int index_group(char *group, char *group_path);
  2269. X  extern int read_group(char *group, char *group_path);
  2270. X  extern void make_threads(int rethread);
  2271. X  extern int parse_headers(FILE *fp, struct article_t *h);
  2272. X  extern void write_index_file(char *group);
  2273. X! extern void read_index_file(char *group_name);
  2274. X! extern int find_index_file(char *group);
  2275. X  extern void do_update(void);
  2276. X  extern int artnum_comp(char *p1, char *p2);
  2277. X  extern int subj_comp(char *p1, char *p2);
  2278. X***************
  2279. X*** 34,39 ****
  2280. X--- 35,41 ----
  2281. X  extern int from_comp(char *p1, char *p2);
  2282. X  extern int date_comp(char *p1, char *p2);
  2283. X  extern void set_article(struct article_t *art);
  2284. X+ extern int input_pending(void);
  2285. X  /* curses.c */
  2286. X  extern void setup_screen(void);
  2287. X  extern int InitScreen(void);
  2288. X***************
  2289. X*** 69,74 ****
  2290. X--- 71,78 ----
  2291. X  /* feed.c */
  2292. X  extern void feed_articles(int function, int level, char *prompt, int respnum, char *group_path);
  2293. X  extern int print_file(char *command, int respnum, int count);
  2294. X+ extern int get_post_proc_type(int proc_type);
  2295. X+ extern int does_article_exist(int function, long artnum, char *path);
  2296. SHAR_EOF
  2297. true || echo 'restore of tin-1.17.patch failed'
  2298. fi
  2299. echo 'End of tin-1.17 part 6'
  2300. echo 'File tin-1.17.patch is continued in part 7'
  2301. echo 7 > _shar_seq_.tmp
  2302. exit 0
  2303.  
  2304. --
  2305. NAMES  Iain Lea    Iain.Lea%anl433.uucp@Germany.EU.net
  2306. SNAIL  Siemens AG, ANL A433SZ, Gruendlacher Str. 248, 8510 Fuerth, Germany.
  2307. PHONE  +49-911-3089-407 (work) +49-911-331963 (home) +49-911-3089-290 (FAX)  
  2308.