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

  1. Newsgroups: comp.sources.misc
  2. From: iain@estevax.uucp (Iain J. Lea)
  3. Subject:  v26i078:  tin - threaded full screen newsreader, Patch06c/5
  4. Message-ID: <1991Nov30.023959.14553@sparky.imd.sterling.com>
  5. X-Md4-Signature: e7239bb027bcf169bba9a34181e4b070
  6. Date: Sat, 30 Nov 1991 02:39:59 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: iain@estevax.uucp (Iain J. Lea)
  10. Posting-number: Volume 26, Issue 78
  11. Archive-name: tin/patch06c
  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.03 (part 3 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" != 3; 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   *  Notes     : reads news locally (/usr/spool/news) or via NNTP
  39. X   *  Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
  40. X***************
  41. X*** 240,246 ****
  42. X  
  43. X  /*
  44. X   *  Read the article numbers existing in a group's spool directory
  45. X!  *  into base[] and sort them.  base_top is one past top.
  46. X   */
  47. X  
  48. X  void setup_base (group, group_path)
  49. X--- 240,246 ----
  50. X  
  51. X  /*
  52. X   *  Read the article numbers existing in a group's spool directory
  53. X!  *  into base[] and sort them.  top_base is one past top.
  54. X   */
  55. X  
  56. X  void setup_base (group, group_path)
  57. X***************
  58. X*** 262,270 ****
  59. X          sprintf (buf, "group %s", group);
  60. X          put_server (buf);
  61. X  
  62. X!         if (get_server(line, NNTP_STRLEN) == -1) {
  63. X!             fprintf(stderr, txt_connection_to_server_broken);
  64. X!             tin_done(1);
  65. X          }
  66. X  
  67. X          if (atoi(line) != OK_GROUP) {
  68. X--- 262,270 ----
  69. X          sprintf (buf, "group %s", group);
  70. X          put_server (buf);
  71. X  
  72. X!         if (get_server (line, NNTP_STRLEN) == -1) {
  73. X!             fprintf (stderr, txt_connection_to_server_broken);
  74. X!             tin_done (1);
  75. X          }
  76. X  
  77. X          if (atoi(line) != OK_GROUP) {
  78. X***************
  79. X*** 313,319 ****
  80. X   *  get a response code from the server and return it to the caller
  81. X   */
  82. X  
  83. X! int get_respcode()
  84. X  {
  85. X  #ifdef USE_NNTP
  86. X      char line[NNTP_STRLEN];
  87. X--- 313,319 ----
  88. X   *  get a response code from the server and return it to the caller
  89. X   */
  90. X  
  91. X! int get_respcode ()
  92. X  {
  93. X  #ifdef USE_NNTP
  94. X      char line[NNTP_STRLEN];
  95. X***************
  96. X*** 375,392 ****
  97. X  
  98. X  FILE *nntp_to_fp ()
  99. X  {
  100. X      char fnam[LEN];
  101. X!     FILE *fp;
  102. X  
  103. X!     if (! stuff_nntp (fnam))
  104. X          return NULL;
  105. X  
  106. X      if ((fp = fopen (fnam, "r")) == NULL) {
  107. X          error_message (txt_nntp_to_fp_cannot_reopen, fnam);
  108. X          return NULL;
  109. X      }
  110. X      unlink (fnam);
  111. X      return fp;
  112. X  }
  113. X  
  114. X  
  115. X--- 375,402 ----
  116. X  
  117. X  FILE *nntp_to_fp ()
  118. X  {
  119. X+ #ifdef USE_NNTP
  120. X      char fnam[LEN];
  121. X!     static FILE *fp = NULL;
  122. X  
  123. X!     if (fp != NULL) {
  124. X!         fclose (fp);
  125. X!     }
  126. X!     
  127. X!     if (! stuff_nntp (fnam)) {
  128. X          return NULL;
  129. X+     }
  130. X  
  131. X      if ((fp = fopen (fnam, "r")) == NULL) {
  132. X          error_message (txt_nntp_to_fp_cannot_reopen, fnam);
  133. X          return NULL;
  134. X      }
  135. X+     
  136. X      unlink (fnam);
  137. X      return fp;
  138. X+ #else
  139. X+     return NULL;
  140. X+ #endif
  141. X  }
  142. X  
  143. X  
  144. X***************
  145. X*** 394,409 ****
  146. X  {
  147. X  #ifdef USE_NNTP
  148. X      char fnam[LEN];
  149. X!     int fd;
  150. X  
  151. X!     if (! stuff_nntp (fnam))
  152. X          return -1;
  153. X  
  154. X      if ((fd = open (fnam, 0)) == -1) {
  155. X          error_message (txt_nntp_to_fd_cannot_reopen, fnam);
  156. X          return -1;
  157. X      }
  158. X      unlink (fnam);
  159. X      return fd;
  160. X  #endif
  161. X  }
  162. X--- 404,427 ----
  163. X  {
  164. X  #ifdef USE_NNTP
  165. X      char fnam[LEN];
  166. X!     static int fd = -1;
  167. X  
  168. X!     if (fd != -1) {
  169. X!         close (fd);
  170. X!     }
  171. X!     
  172. X!     if (! stuff_nntp (fnam)) {
  173. X          return -1;
  174. X+     }
  175. X  
  176. X      if ((fd = open (fnam, 0)) == -1) {
  177. X          error_message (txt_nntp_to_fd_cannot_reopen, fnam);
  178. X          return -1;
  179. X      }
  180. X+     
  181. X      unlink (fnam);
  182. X      return fd;
  183. X+ #else
  184. X+     return -1;
  185. X  #endif
  186. X  }
  187. Xdiff -rcs ../105/page.c ./page.c
  188. X*** ../105/page.c    Thu Oct 10 20:40:47 1991
  189. X--- ./page.c    Mon Nov  4 17:56:18 1991
  190. X***************
  191. X*** 3,9 ****
  192. X   *  Module    : page.c
  193. X   *  Author    : R.Skrenta / I.Lea
  194. X   *  Created   : 01-04-91
  195. X!  *  Updated   : 10-10-91
  196. X   *  Release   : 1.0
  197. X   *  Notes     :
  198. X   *  Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
  199. X--- 3,9 ----
  200. X   *  Module    : page.c
  201. X   *  Author    : R.Skrenta / I.Lea
  202. X   *  Created   : 01-04-91
  203. X!  *  Updated   : 31-10-91
  204. X   *  Release   : 1.0
  205. X   *  Notes     :
  206. X   *  Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
  207. X***************
  208. X*** 22,28 ****
  209. X  char note_h_path[LEN];            /* Path:    */
  210. X  char note_h_date[LEN];            /* Date:    */
  211. X  char note_h_subj[LEN];            /* Subject:    */
  212. X- char note_h_from[LEN];            /* From:    */
  213. X  char note_h_org[LEN];            /* Organization: */
  214. X  char note_h_newsgroups[LEN];    /* Newsgroups:    */
  215. X  char note_h_messageid[LEN];        /* Message-ID:    */
  216. X--- 22,27 ----
  217. X***************
  218. X*** 29,36 ****
  219. X  char note_h_distrib[LEN];        /* Distribution: */
  220. X  char note_h_followup[LEN];        /* Followup-To: */
  221. X  
  222. X- char note_full_name[100];
  223. X- char note_from_addr[100];
  224. X  char *glob_page_group;
  225. X  
  226. X  FILE *note_fp;                    /* the body of the current article */
  227. X--- 28,33 ----
  228. X***************
  229. X*** 417,423 ****
  230. X                  if (kill_state == NO_KILLING &&
  231. X                      sort_art_type != old_sort_art_type) {
  232. X                      make_threads (TRUE);
  233. X!                     find_base ();
  234. X                  }
  235. X                  if (kill_state == KILLING) {
  236. X                      old_top = top;
  237. X--- 414,420 ----
  238. X                  if (kill_state == NO_KILLING &&
  239. X                      sort_art_type != old_sort_art_type) {
  240. X                      make_threads (TRUE);
  241. X!                     find_base (show_only_unread);
  242. X                  }
  243. X                  if (kill_state == KILLING) {
  244. X                      old_top = top;
  245. X***************
  246. X*** 536,547 ****
  247. X                  break;
  248. X      
  249. X              case 'r':    /* reply to author through mail */
  250. X!                 mail_to_author (FALSE);
  251. X                  redraw_page (respnum, group);
  252. X                  break;
  253. X  
  254. X              case 'R':    /* reply to author, copy text */
  255. X!                 mail_to_author (TRUE);
  256. X                  redraw_page (respnum, group);
  257. X                  break;
  258. X  
  259. X--- 533,544 ----
  260. X                  break;
  261. X      
  262. X              case 'r':    /* reply to author through mail */
  263. X!                 mail_to_author (respnum, FALSE);
  264. X                  redraw_page (respnum, group);
  265. X                  break;
  266. X  
  267. X              case 'R':    /* reply to author, copy text */
  268. X!                 mail_to_author (respnum, TRUE);
  269. X                  redraw_page (respnum, group);
  270. X                  break;
  271. X  
  272. X***************
  273. X*** 639,644 ****
  274. X--- 636,642 ----
  275. X      int i, j;
  276. X      int ctrl_L;        /* form feed character detected */
  277. X      long tmp_pos;
  278. X+ 
  279. X      ClearScreen ();
  280. X  
  281. X      note_line = 1;
  282. X***************
  283. X*** 657,663 ****
  284. X  
  285. X      ctrl_L = FALSE;
  286. X      while (note_line < LINES) {
  287. X!         if (fgets(buf, sizeof buf, note_fp) == NULL) {
  288. X              note_end = TRUE;
  289. X              break;
  290. X          }
  291. X--- 655,661 ----
  292. X  
  293. X      ctrl_L = FALSE;
  294. X      while (note_line < LINES) {
  295. X!         if (fgets (buf, sizeof (buf), note_fp) == NULL) {
  296. X              note_end = TRUE;
  297. X              break;
  298. X          }
  299. X***************
  300. X*** 664,671 ****
  301. X  
  302. X          buf[LEN-1] = '\0';
  303. X          if (rotate)
  304. X!             for (p = buf, q = buf2;
  305. X!                     *p && *p != '\n' && q<&buf2[LEN]; p++) {
  306. X                  if (*p == '\b' && q > buf2) {
  307. X                      q--;
  308. X                  } else if (*p == 12) {        /* ^L */
  309. X--- 662,668 ----
  310. X  
  311. X          buf[LEN-1] = '\0';
  312. X          if (rotate)
  313. X!             for (p = buf, q = buf2; *p && *p != '\n' && q < &buf2[LEN]; p++) {
  314. X                  if (*p == '\b' && q > buf2) {
  315. X                      q--;
  316. X                  } else if (*p == 12) {        /* ^L */
  317. X***************
  318. X*** 689,696 ****
  319. X                      *q++ = *p;
  320. X              }
  321. X          else
  322. X!             for (p = buf, q = buf2;
  323. X!                     *p && *p != '\n' && q<&buf2[LEN]; p++) {
  324. X                  if (*p == '\b' && q > buf2) {
  325. X                      q--;
  326. X                  } else if (*p == 12) {        /* ^L */
  327. X--- 686,692 ----
  328. X                      *q++ = *p;
  329. X              }
  330. X          else
  331. X!             for (p = buf, q = buf2; *p && *p != '\n' && q < &buf2[LEN]; p++) {
  332. X                  if (*p == '\b' && q > buf2) {
  333. X                      q--;
  334. X                  } else if (*p == 12) {        /* ^L */
  335. X***************
  336. X*** 814,832 ****
  337. X              printf (txt_x_resp, x_resp);
  338. X      }
  339. X  
  340. X!     if (*note_h_org)
  341. X!         sprintf (tmp, txt_s_at_s, note_full_name, note_h_org);
  342. X!     else
  343. X!         strcpy (tmp, note_full_name);
  344. X  
  345. X!     tmp[LEN] = '\0';
  346. X  
  347. X!     sprintf (buf, "%s  ", note_from_addr);
  348. X  
  349. X      pos = COLS - 1 - (int) strlen(tmp);
  350. X      if ((int) strlen (buf) + (int) strlen (tmp) >= COLS - 1) {
  351. X          strncat (buf, tmp, COLS - 1 - (int) strlen(buf));
  352. X!         buf[COLS - 1] = '\0';
  353. X      } else {
  354. X          for (i = strlen(buf); i < pos; i++)
  355. X              buf[i] = ' ';
  356. X--- 810,833 ----
  357. X              printf (txt_x_resp, x_resp);
  358. X      }
  359. X  
  360. X!     if (*note_h_org) {
  361. X!         if (strcmp (arts[respnum].from, arts[respnum].name) == 0) {
  362. X!             strcpy (tmp, note_h_org);
  363. X!         } else {
  364. X!             sprintf (tmp, txt_s_at_s, arts[respnum].name, note_h_org);
  365. X!         }
  366. X!     } else {
  367. X!         strcpy (tmp, arts[respnum].name);
  368. X!     }
  369. X  
  370. X!     tmp[LEN-1] = '\0';
  371. X  
  372. X!     sprintf (buf, "%s  ", arts[respnum].from);
  373. X  
  374. X      pos = COLS - 1 - (int) strlen(tmp);
  375. X      if ((int) strlen (buf) + (int) strlen (tmp) >= COLS - 1) {
  376. X          strncat (buf, tmp, COLS - 1 - (int) strlen(buf));
  377. X!         buf[COLS-1] = '\0';
  378. X      } else {
  379. X          for (i = strlen(buf); i < pos; i++)
  380. X              buf[i] = ' ';
  381. X***************
  382. X*** 886,892 ****
  383. X          return;
  384. X      }
  385. X  
  386. X-     note_h_from[0] = '\0';
  387. X      note_h_path[0] = '\0';
  388. X      note_h_subj[0] = '\0';
  389. X      note_h_org[0] = '\0';
  390. X--- 887,892 ----
  391. X***************
  392. X*** 907,915 ****
  393. X          
  394. X          if (*buf == '\0')
  395. X              break;
  396. X! 
  397. X            if (match_header (buf, "From", note_h_from, LEN))
  398. X                continue;
  399. X            if (match_header (buf, "Path", note_h_path, LEN))
  400. X                continue;
  401. X            if (match_header (buf, "Subject", note_h_subj, LEN))
  402. X--- 907,916 ----
  403. X          
  404. X          if (*buf == '\0')
  405. X              break;
  406. X! /*
  407. X            if (match_header (buf, "From", note_h_from, LEN))
  408. X                continue;
  409. X+ */            
  410. X            if (match_header (buf, "Path", note_h_path, LEN))
  411. X                continue;
  412. X            if (match_header (buf, "Subject", note_h_subj, LEN))
  413. X***************
  414. X*** 933,939 ****
  415. X--- 934,942 ----
  416. X      note_page = 0;
  417. X      note_mark[0] = ftell (note_fp);
  418. X  
  419. X+ /*
  420. X      parse_from (note_h_from, note_from_addr, note_full_name);
  421. X+ */    
  422. X      note_end = FALSE;
  423. X  
  424. X      return;
  425. X***************
  426. X*** 942,949 ****
  427. X  
  428. X  void art_close ()
  429. X  {
  430. X!     if (note_page != NOTE_UNAVAIL)
  431. X          fclose (note_fp);
  432. X  }
  433. X  
  434. X  
  435. X--- 945,954 ----
  436. X  
  437. X  void art_close ()
  438. X  {
  439. X!     if (note_fp && note_page != NOTE_UNAVAIL) {
  440. X          fclose (note_fp);
  441. X+         note_fp = (FILE *) 0;
  442. X+     }
  443. X  }
  444. X  
  445. X  
  446. X***************
  447. X*** 980,1021 ****
  448. X  
  449. X      return j;
  450. X  }
  451. X- 
  452. X- 
  453. X- /*
  454. X-  *  Parse various From: lines into the component mail addresses and
  455. X-  *  real names
  456. X-  */
  457. X- 
  458. X- void parse_from (str, addr, name)
  459. X-     char *str;
  460. X-     char *addr;
  461. X-     char *name;
  462. X- {
  463. X-     char *p;
  464. X-     
  465. X-     for (p=str ; *p ; p++) {
  466. X-         if (((*p) & 0xFF) < ' ')
  467. X-             *p = ' ';
  468. X-     }
  469. X- 
  470. X-     while (*str && *str != ' ')
  471. X-         *addr++ = *str++;
  472. X-     *addr = '\0';
  473. X-     if (*str++ == ' ') {
  474. X-         if (*str++ == '(') {
  475. X-             if (*str == '"')
  476. X-                 str++;  /* Kill "quotes around names"         */
  477. X-                     /* But don't touch quotes inside the  */
  478. X-                     /* Name (that's what that nonsense    */
  479. X-                     /* below is for                  */
  480. X-             while (*str && *str != ')' && !(*str=='"'&&str[1]==')'))
  481. X-                 *name++ = *str++;
  482. X-         }
  483. X-     }
  484. X-     *name = '\0';
  485. X- }
  486. X- 
  487. X  
  488. X  /*
  489. X   *  Find the previous response.  Go to the last response in the previous
  490. X--- 985,990 ----
  491. Xdiff -rcs ../105/patchlevel.h ./patchlevel.h
  492. X*** ../105/patchlevel.h    Wed Oct  2 20:21:38 1991
  493. X--- ./patchlevel.h    Mon Nov  4 19:12:08 1991
  494. X***************
  495. X*** 1 ****
  496. X! #define PATCHLEVEL    5
  497. X--- 1 ----
  498. X! #define PATCHLEVEL    6
  499. Xdiff -rcs ../105/post.c ./post.c
  500. X*** ../105/post.c    Wed Oct 16 20:32:39 1991
  501. X--- ./post.c    Thu Oct 31 18:21:59 1991
  502. X***************
  503. X*** 3,9 ****
  504. X   *  Module    : post.c
  505. X   *  Author    : I.Lea
  506. X   *  Created   : 01-04-91
  507. X!  *  Updated   : 16-10-91
  508. X   *  Release   : 1.0
  509. X   *  Notes     : mailing/posting/replying/followup & cancel article routines
  510. X   *  Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
  511. X--- 3,9 ----
  512. X   *  Module    : post.c
  513. X   *  Author    : I.Lea
  514. X   *  Created   : 01-04-91
  515. X!  *  Updated   : 31-10-91
  516. X   *  Release   : 1.0
  517. X   *  Notes     : mailing/posting/replying/followup & cancel article routines
  518. X   *  Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
  519. X***************
  520. X*** 17,30 ****
  521. X  
  522. X  extern char note_h_distrib[LEN];        /* Distribution: */
  523. X  extern char note_h_followup[LEN];        /* Followup-To: */
  524. X- extern char note_h_from[LEN];            /* From:    */
  525. X  extern char note_h_messageid[LEN];        /* Message-ID:    */
  526. X  extern char note_h_newsgroups[LEN];        /* Newsgroups:    */
  527. X  extern char note_h_subj[LEN];            /* Subject:    */
  528. X  
  529. X- extern char note_from_addr[100];
  530. X- extern char note_full_name[100];
  531. X- 
  532. X  extern FILE *note_fp;                    /* the body of the current article */
  533. X  
  534. X  extern long note_mark[MAX_PAGES];        /* ftells on beginnings of pages */
  535. X--- 17,26 ----
  536. X***************
  537. X*** 203,208 ****
  538. X--- 199,205 ----
  539. X          switch (ch) {
  540. X          case 'e':
  541. X              invoke_editor (article);
  542. X+              set_real_uid_gid ();
  543. X              redraw_screen = TRUE;
  544. X              break;
  545. X  
  546. X***************
  547. X*** 321,328 ****
  548. X      fprintf (fp, "\n");
  549. X  
  550. X      if (respnum) {        /* if "copy_text" */
  551. X!         if (note_h_from[0]) {     
  552. X!             fprintf (fp, txt_writes, note_h_from);
  553. X          }
  554. X          fseek (note_fp, note_mark[0], 0);
  555. X          copy_fp (note_fp, fp, DEFAULT_COMMENT);
  556. X--- 318,325 ----
  557. X      fprintf (fp, "\n");
  558. X  
  559. X      if (respnum) {        /* if "copy_text" */
  560. X!         if (arts[respnum].from != (char *) 0) {     
  561. X!             fprintf (fp, txt_writes, arts[respnum].from, arts[respnum].from);
  562. X          }
  563. X          fseek (note_fp, note_mark[0], 0);
  564. X          copy_fp (note_fp, fp, DEFAULT_COMMENT);
  565. X***************
  566. X*** 336,341 ****
  567. X--- 333,339 ----
  568. X          switch (ch) {
  569. X          case 'e':
  570. X              invoke_editor (article);
  571. X+              set_real_uid_gid ();
  572. X              redraw_screen = TRUE;
  573. X              break;
  574. X  
  575. X***************
  576. X*** 485,490 ****
  577. X--- 483,489 ----
  578. X  {
  579. X      char nam[100];
  580. X      FILE *fp;
  581. X+     FILE *fp_uname;
  582. X      char ch;
  583. X      char ch_default = 's';
  584. X      char buf[LEN];
  585. X***************
  586. X*** 515,523 ****
  587. X          fprintf (fp, "Reply-To: %s\n", reply_to);
  588. X          start_line_offset++;
  589. X      }
  590. X!     fprintf (fp, "\nPlease enter the following information:\n");
  591. X!     fprintf (fp, "1) machine:\n");
  592. X!     fprintf (fp, "2) os type:\n");
  593. X      fprintf (fp, "\nPlease enter bug/gripe/comment report:\n");
  594. X  
  595. X      add_signature (fp, TRUE);
  596. X--- 514,533 ----
  597. X          fprintf (fp, "Reply-To: %s\n", reply_to);
  598. X          start_line_offset++;
  599. X      }
  600. X! 
  601. X!     if ((fp_uname = popen ("uname -a", "r")) != NULL) {
  602. X!         fgets (buf, sizeof (buf), fp_uname);
  603. X!         fclose (fp_uname);
  604. X!     }
  605. X! 
  606. X!     if (strlen (buf)) {
  607. X!         fprintf (fp, "\n%s", buf);
  608. X!         start_line_offset += 2;
  609. X!     } else {
  610. X!         fprintf (fp, "\nPlease enter the following information:\n");
  611. X!         fprintf (fp, "1) machine:\n");
  612. X!         fprintf (fp, "2) os type:\n");
  613. X!     }
  614. X      fprintf (fp, "\nPlease enter bug/gripe/comment report:\n");
  615. X  
  616. X      add_signature (fp, TRUE);
  617. X***************
  618. X*** 569,575 ****
  619. X  }
  620. X  
  621. X  
  622. X! int mail_to_author (copy_text)
  623. X      int copy_text;
  624. X  {
  625. X      char buf[LEN];
  626. X--- 579,586 ----
  627. X  }
  628. X  
  629. X  
  630. X! int mail_to_author (respnum, copy_text)
  631. X!     int respnum;
  632. X      int copy_text;
  633. X  {
  634. X      char buf[LEN];
  635. X***************
  636. X*** 593,599 ****
  637. X      }
  638. X      chmod (nam, 0600);
  639. X  
  640. X!     fprintf (fp, "To: %s%s (%s)\n", note_from_addr, add_addr, note_full_name);
  641. X      fprintf (fp, "Subject: Re: %s\n", eat_re(note_h_subj) );
  642. X      fprintf (fp, "Newsgroups: %s\n", note_h_newsgroups);
  643. X      if (*my_org) {
  644. X--- 604,611 ----
  645. X      }
  646. X      chmod (nam, 0600);
  647. X  
  648. X!     fprintf (fp, "To: %s%s (%s)\n",
  649. X!         arts[respnum].from, add_addr, arts[respnum].name);
  650. X      fprintf (fp, "Subject: Re: %s\n", eat_re(note_h_subj) );
  651. X      fprintf (fp, "Newsgroups: %s\n", note_h_newsgroups);
  652. X      if (*my_org) {
  653. X***************
  654. X*** 631,637 ****
  655. X              return (redraw_screen);
  656. X  
  657. X          case 's':
  658. X!             strcpy (mail_to, note_from_addr);
  659. X              find_new_to (nam, mail_to);
  660. X              sprintf (msg, txt_mailing_to, mail_to);
  661. X              wait_message (msg);
  662. X--- 643,649 ----
  663. X              return (redraw_screen);
  664. X  
  665. X          case 's':
  666. X!             strcpy (mail_to, arts[respnum].from);
  667. X              find_new_to (nam, mail_to);
  668. X              sprintf (msg, txt_mailing_to, mail_to);
  669. X              wait_message (msg);
  670. X***************
  671. X*** 766,771 ****
  672. X--- 778,784 ----
  673. X          switch (ch) {
  674. X          case 'e':
  675. X              invoke_editor (cancel);
  676. X+              set_real_uid_gid ();
  677. X              redraw_screen = TRUE;
  678. X              break;
  679. X  
  680. X***************
  681. X*** 795,803 ****
  682. X      return (redraw_screen);
  683. X  }
  684. X  
  685. X! int
  686. X! submit_file(name)
  687. X! char*    name;
  688. X  {
  689. X      char    buf[LEN];
  690. X      char*    cp = buf;
  691. X--- 808,815 ----
  692. X      return (redraw_screen);
  693. X  }
  694. X  
  695. X! int submit_file(name)
  696. X!     char *name;
  697. X  {
  698. X      char    buf[LEN];
  699. X      char*    cp = buf;
  700. X***************
  701. X*** 808,819 ****
  702. X      cp = &buf[strlen(buf)];
  703. X  #endif
  704. X  
  705. X!     if (debug)
  706. X          sprintf (cp, "inews -h < %s", name);
  707. X!     else
  708. X          sprintf (cp, "inews -h < %s > /dev/null 2>&1", name);
  709. X! 
  710. X!     if (invoke_cmd(buf))
  711. X          return TRUE;
  712. X      return FALSE;
  713. X  }
  714. X--- 820,835 ----
  715. X      cp = &buf[strlen(buf)];
  716. X  #endif
  717. X  
  718. X!     if (debug) {
  719. X          sprintf (cp, "inews -h < %s", name);
  720. X!     } else {
  721. X          sprintf (cp, "inews -h < %s > /dev/null 2>&1", name);
  722. X!     }
  723. X!     
  724. X!     if (invoke_cmd(buf)) {
  725. X!          set_real_uid_gid ();
  726. X          return TRUE;
  727. X+     }
  728. X+     set_real_uid_gid ();
  729. X      return FALSE;
  730. X  }
  731. XFiles ../105/prompt.c and ./prompt.c are identical
  732. Xdiff -rcs ../105/proto.h ./proto.h
  733. X*** ../105/proto.h    Wed Oct 16 19:52:10 1991
  734. X--- ./proto.h    Thu Oct 31 18:36:04 1991
  735. X***************
  736. X*** 2,8 ****
  737. X   
  738. X  /* art.c */
  739. X  long my_atol(char *s, int n);
  740. X! void find_base(void);
  741. X  int num_of_arts(void);
  742. X  int valid_artnum(long art);
  743. X  int purge_needed(void);
  744. X--- 2,8 ----
  745. X   
  746. X  /* art.c */
  747. X  long my_atol(char *s, int n);
  748. X! void find_base(int only_unread);
  749. X  int num_of_arts(void);
  750. X  int valid_artnum(long art);
  751. X  int purge_needed(void);
  752. X***************
  753. X*** 28,33 ****
  754. X--- 28,34 ----
  755. X  /* curses.c */
  756. X  int InitScreen(void);
  757. X  void ScreenSize(int *num_lines, int *num_columns);
  758. X+ void InitWin(void);
  759. X  void EndWin(void);
  760. X  void ClearScreen(void);
  761. X  void MoveCursor(int row, int col);
  762. X***************
  763. X*** 117,122 ****
  764. X--- 118,124 ----
  765. X  void basename(char *dirname, char *program);
  766. X  void mail_setup(void);
  767. X  int mail_check(void);
  768. X+ void parse_from(char *str, char *addr, char *name);
  769. X  /* newsrc.c */
  770. X  void backup_newsrc(void);
  771. X  void read_newsrc(int sub_only);
  772. X***************
  773. X*** 158,164 ****
  774. X  void art_close(void);
  775. X  int prompt_response(int ch, int respnum);
  776. X  int choose_resp(int i, int n);
  777. X- void parse_from(char *str, char *addr, char *name);
  778. X  int prev_response(int n);
  779. X  int next_response(int n);
  780. X  int next_basenote(int n);
  781. X--- 160,165 ----
  782. X***************
  783. X*** 172,178 ****
  784. X  int post_response(char *group, int respnum);
  785. X  int mail_to_someone(char *address);
  786. X  int mail_bug_report(void);
  787. X! int mail_to_author(int copy_text);
  788. X  void find_new_to(char *nam, char *mail_to);
  789. X  int cancel_article(void);
  790. X  int submit_file(char *name);
  791. X--- 173,179 ----
  792. X  int post_response(char *group, int respnum);
  793. X  int mail_to_someone(char *address);
  794. X  int mail_bug_report(void);
  795. X! int mail_to_author(int respnum, int copy_text);
  796. X  void find_new_to(char *nam, char *mail_to);
  797. X  int cancel_article(void);
  798. X  int submit_file(char *name);
  799. X***************
  800. X*** 187,192 ****
  801. X--- 188,194 ----
  802. X  void write_rcfile(void);
  803. X  int change_rcfile(char *group, int kill_at_once);
  804. X  void show_rcfile_menu(void);
  805. X+ void prompt_on_off(int row, int col, int *var, char *help_text, char *prompt_text);
  806. X  void expand_rel_abs_pathname(int line, int col, char *str);
  807. X  void show_menu_help(char *help_message);
  808. X  /* save.c */
  809. X***************
  810. X*** 207,213 ****
  811. X  void post_process_sh(void);
  812. X  char *get_archive_file(char *dir, char *ext);
  813. X  void delete_processed_files(void);
  814. X- void post_process_patch(void);
  815. X  /* screen.c */
  816. X  void info_message(char *str);
  817. X  void wait_message(char *str);
  818. X--- 209,214 ----
  819. X***************
  820. X*** 221,227 ****
  821. X  void search_group(int forward);
  822. X  void search_subject(int forward, char *group);
  823. X  int search_article(int forward);
  824. X! char *str_str(char *text, char *pattern);
  825. X  void make_lower(char *s, char *t);
  826. X  /* select.c */
  827. X  void selection_index(int start_groupnum);
  828. X--- 222,228 ----
  829. X  void search_group(int forward);
  830. X  void search_subject(int forward, char *group);
  831. X  int search_article(int forward);
  832. X! char *str_str(char *text, char *pattern, int patlen);
  833. X  void make_lower(char *s, char *t);
  834. X  /* select.c */
  835. X  void selection_index(int start_groupnum);
  836. X***************
  837. X*** 258,264 ****
  838. X   
  839. X  /* art.c */
  840. X  long my_atol(/*char *s, int n*/);
  841. X! void find_base(/*void*/);
  842. X  int num_of_arts(/*void*/);
  843. X  int valid_artnum(/*long art*/);
  844. X  int purge_needed(/*void*/);
  845. X--- 259,265 ----
  846. X   
  847. X  /* art.c */
  848. X  long my_atol(/*char *s, int n*/);
  849. X! void find_base(/*int only_unread*/);
  850. X  int num_of_arts(/*void*/);
  851. X  int valid_artnum(/*long art*/);
  852. X  int purge_needed(/*void*/);
  853. X***************
  854. X*** 284,289 ****
  855. X--- 285,291 ----
  856. X  /* curses.c */
  857. X  int InitScreen(/*void*/);
  858. X  void ScreenSize(/*int *num_lines, int *num_columns*/);
  859. X+ void InitWin(/*void*/);
  860. X  void EndWin(/*void*/);
  861. X  void ClearScreen(/*void*/);
  862. X  void MoveCursor(/*int row, int col*/);
  863. X***************
  864. X*** 373,378 ****
  865. X--- 375,381 ----
  866. X  void basename(/*char *dirname, char *program*/);
  867. X  void mail_setup(/*void*/);
  868. X  int mail_check(/*void*/);
  869. X+ void parse_from(/*char *str, char *addr, char *name*/);
  870. X  /* newsrc.c */
  871. X  void backup_newsrc(/*void*/);
  872. X  void read_newsrc(/*int sub_only*/);
  873. X***************
  874. X*** 414,420 ****
  875. X  void art_close(/*void*/);
  876. X  int prompt_response(/*int ch, int respnum*/);
  877. X  int choose_resp(/*int i, int n*/);
  878. X- void parse_from(/*char *str, char *addr, char *name*/);
  879. X  int prev_response(/*int n*/);
  880. X  int next_response(/*int n*/);
  881. X  int next_basenote(/*int n*/);
  882. X--- 417,422 ----
  883. X***************
  884. X*** 428,434 ****
  885. X  int post_response(/*char *group, int respnum*/);
  886. X  int mail_to_someone(/*char *address*/);
  887. X  int mail_bug_report(/*void*/);
  888. X! int mail_to_author(/*int copy_text*/);
  889. X  void find_new_to(/*char *nam, char *mail_to*/);
  890. X  int cancel_article(/*void*/);
  891. X  int submit_file(/*char *name*/);
  892. X--- 430,436 ----
  893. X  int post_response(/*char *group, int respnum*/);
  894. X  int mail_to_someone(/*char *address*/);
  895. X  int mail_bug_report(/*void*/);
  896. X! int mail_to_author(/*int respnum, int copy_text*/);
  897. X  void find_new_to(/*char *nam, char *mail_to*/);
  898. X  int cancel_article(/*void*/);
  899. X  int submit_file(/*char *name*/);
  900. X***************
  901. X*** 443,448 ****
  902. X--- 445,451 ----
  903. X  void write_rcfile(/*void*/);
  904. X  int change_rcfile(/*char *group, int kill_at_once*/);
  905. X  void show_rcfile_menu(/*void*/);
  906. X+ void prompt_on_off(/*int row, int col, int *var, char *help_text, char *prompt_text*/);
  907. X  void expand_rel_abs_pathname(/*int line, int col, char *str*/);
  908. X  void show_menu_help(/*char *help_message*/);
  909. X  /* save.c */
  910. X***************
  911. X*** 463,469 ****
  912. X  void post_process_sh(/*void*/);
  913. X  char *get_archive_file(/*char *dir, char *ext*/);
  914. X  void delete_processed_files(/*void*/);
  915. X- void post_process_patch(/*void*/);
  916. X  /* screen.c */
  917. X  void info_message(/*char *str*/);
  918. X  void wait_message(/*char *str*/);
  919. X--- 466,471 ----
  920. X***************
  921. X*** 477,483 ****
  922. X  void search_group(/*int forward*/);
  923. X  void search_subject(/*int forward, char *group*/);
  924. X  int search_article(/*int forward*/);
  925. X! char *str_str(/*char *text, char *pattern*/);
  926. X  void make_lower(/*char *s, char *t*/);
  927. X  /* select.c */
  928. X  void selection_index(/*int start_groupnum*/);
  929. X--- 479,485 ----
  930. X  void search_group(/*int forward*/);
  931. X  void search_subject(/*int forward, char *group*/);
  932. X  int search_article(/*int forward*/);
  933. X! char *str_str(/*char *text, char *pattern, int patlen*/);
  934. X  void make_lower(/*char *s, char *t*/);
  935. X  /* select.c */
  936. X  void selection_index(/*int start_groupnum*/);
  937. Xdiff -rcs ../105/rcfile.c ./rcfile.c
  938. X*** ../105/rcfile.c    Tue Oct  8 10:46:42 1991
  939. X--- ./rcfile.c    Mon Nov  4 16:10:56 1991
  940. X***************
  941. X*** 3,9 ****
  942. X   *  Module    : rcfile.c
  943. X   *  Author    : I.Lea
  944. X   *  Created   : 01-04-91
  945. X!  *  Updated   : 09-10-91
  946. X   *  Release   : 1.0
  947. X   *  Notes     :
  948. X   *  Copyright : (c) Copyright 1991 by Iain Lea
  949. X--- 3,9 ----
  950. X   *  Module    : rcfile.c
  951. X   *  Author    : I.Lea
  952. X   *  Created   : 01-04-91
  953. X!  *  Updated   : 31-10-91
  954. X   *  Release   : 1.0
  955. X   *  Notes     :
  956. X   *  Copyright : (c) Copyright 1991 by Iain Lea
  957. X***************
  958. X*** 15,24 ****
  959. X  
  960. X  #include    "tin.h"
  961. X  
  962. X- #define COL2    COLS/2
  963. X- 
  964. X  extern char index_file[LEN];
  965. X  
  966. X  /*
  967. X   *  read_rcfile - read defaults from ~/.tin/tinrc
  968. X   */
  969. X--- 15,28 ----
  970. X  
  971. X  #include    "tin.h"
  972. X  
  973. X  extern char index_file[LEN];
  974. X+ extern int index_point;
  975. X+ extern int space_mode;
  976. X  
  977. X+ static int COL1;
  978. X+ static int COL2;
  979. X+ static int COL3;
  980. X+ 
  981. X  /*
  982. X   *  read_rcfile - read defaults from ~/.tin/tinrc
  983. X   */
  984. X***************
  985. X*** 39,46 ****
  986. X                      mark_saved_read = (strncmp (&buf[16], "ON", 2) == 0 ? TRUE : FALSE);
  987. X                  } else if (strncmp (buf, "kill_articles=", 14) == 0) {
  988. X                      kill_articles = (strncmp (&buf[14], "ON", 2) == 0 ? TRUE : FALSE);
  989. X-                 } else if (strncmp (buf, "show_author=", 12) == 0) {
  990. X-                     show_author = (strncmp (&buf[12], "ON", 2) == 0 ? TRUE : FALSE);
  991. X                  } else if (strncmp (buf, "draw_arrow=", 11) == 0) {
  992. X                      draw_arrow_mark = (strncmp (&buf[11], "ON", 2) == 0 ? TRUE : FALSE);
  993. X                      if (draw_arrow_mark == FALSE && inverse_okay == FALSE) {
  994. X--- 43,48 ----
  995. X***************
  996. X*** 50,57 ****
  997. X--- 52,67 ----
  998. X                      print_header = (strncmp (&buf[13], "ON", 2) == 0 ? TRUE : FALSE);
  999. X                  } else if (strncmp (buf, "pos_first_unread=", 17) == 0) {
  1000. X                      pos_first_unread = (strncmp (&buf[17], "ON", 2) == 0 ? TRUE : FALSE);
  1001. X+                 } else if (strncmp (buf, "full_page_scroll=", 17) == 0) {
  1002. X+                     full_page_scroll = (strncmp (&buf[17], "ON", 2) == 0 ? TRUE : FALSE);
  1003. X+                 } else if (strncmp (buf, "catchup_read_groups=", 20) == 0) {
  1004. X+                     catchup_read_groups = (strncmp (&buf[20], "ON", 2) == 0 ? TRUE : FALSE);
  1005. X                  } else if (strncmp (buf, "thread_articles=", 16) == 0) {
  1006. X                      thread_arts = (strncmp (&buf[16], "ON", 2) == 0 ? TRUE : FALSE);
  1007. X+                 } else if (strncmp (buf, "show_only_unread=", 17) == 0) {
  1008. X+                     show_only_unread = (strncmp (&buf[17], "ON", 2) == 0 ? TRUE : FALSE);
  1009. X+                 } else if (strncmp (buf, "show_author=", 12) == 0) {
  1010. X+                     show_author = atoi (&buf[12]);
  1011. X                  } else if (strncmp (buf, "post_process_type=", 18) == 0) {
  1012. X                      post_proc_type = atoi (&buf[18]);
  1013. X                      switch (post_proc_type) {
  1014. X***************
  1015. X*** 70,78 ****
  1016. X                          case POST_PROC_UUD_EXT_ZOO:
  1017. X                              proc_ch_default = 'U';
  1018. X                              break;
  1019. X-                         case POST_PROC_PATCH:
  1020. X-                             proc_ch_default = 'p';
  1021. X-                             break;
  1022. X                      }
  1023. X                  } else if (strncmp (buf, "sort_article_type=", 18) == 0) {
  1024. X                      sort_art_type = atoi (&buf[18]);
  1025. X--- 80,85 ----
  1026. X***************
  1027. X*** 132,139 ****
  1028. X          fprintf (fp, "save_separate=%s\n\n", (save_separate ? "ON" : "OFF"));
  1029. X          fprintf (fp, "# if ON mark articles that are saved as read\n");
  1030. X          fprintf (fp, "mark_saved_read=%s\n\n", (mark_saved_read ? "ON" : "OFF"));
  1031. X-         fprintf (fp, "# if ON show Subject & From otherwise just Subject\n");
  1032. X-         fprintf (fp, "show_author=%s\n\n", (show_author ? "ON" : "OFF"));
  1033. X          fprintf (fp, "# if ON use -> otherwise highlighted bar for selection\n");
  1034. X          fprintf (fp, "draw_arrow=%s\n\n", (draw_arrow_mark ? "ON" : "OFF"));
  1035. X          fprintf (fp, "# if ON kill articles that match kill file\n");
  1036. X--- 139,144 ----
  1037. X***************
  1038. X*** 142,152 ****
  1039. X--- 147,165 ----
  1040. X          fprintf (fp, "print_header=%s\n\n", (print_header ? "ON" : "OFF"));
  1041. X          fprintf (fp, "# if ON put cursor at first unread art in group otherwise last art\n");
  1042. X          fprintf (fp, "pos_first_unread=%s\n\n", (pos_first_unread ? "ON" : "OFF"));
  1043. X+         fprintf (fp, "# if ON scroll full page of groups/articles otherwise half a page\n");
  1044. X+         fprintf (fp, "full_page_scroll=%s\n\n", (full_page_scroll ? "ON" : "OFF"));
  1045. X+         fprintf (fp, "# if ON ask user if read groups should all be marked read\n");
  1046. X+         fprintf (fp, "catchup_read_groups=%s\n\n", (catchup_read_groups ? "ON" : "OFF"));
  1047. X+         fprintf (fp, "# part of from field to display 0) none 1) address 2) full name 3) both\n");
  1048. X+         fprintf (fp, "show_author=%d\n\n", show_author);
  1049. X          fprintf (fp, "# type of post processing to perform after saving articles.\n");
  1050. X          fprintf (fp, "# 0) none 1) shar 2) uudecode 3) uud & list zoo 4) uud & extract zoo 5) patch.\n");
  1051. X          fprintf (fp, "post_process_type=%d\n\n", post_proc_type);
  1052. X          fprintf (fp, "# if ON and group not in ~/.tin/unthread articles will be threaded.\n");
  1053. X          fprintf (fp, "thread_articles=%s\n\n", (thread_arts ? "ON" : "OFF"));
  1054. X+         fprintf (fp, "# if ON show only new/unread articles otherwise show all.\n");
  1055. X+         fprintf (fp, "show_only_unread=%s\n\n", (show_only_unread ? "ON" : "OFF"));
  1056. X          fprintf (fp, "# sort articles by 0) nothing 1) Subject (descending) 2) Subject (ascending)\n");
  1057. X          fprintf (fp, "# 3) From (descend) 4) From (ascend) 5) Date (descend) 6) Date (ascend)\n");
  1058. X          fprintf (fp, "sort_article_type=%d\n\n", sort_art_type);
  1059. X***************
  1060. X*** 179,189 ****
  1061. X      int kill_at_once;
  1062. X  {
  1063. X      char *str;
  1064. X!     int ch;
  1065. X      int kill_changed = FALSE;
  1066. X      int orig_kill_state;
  1067. X      int option;
  1068. X      int ret_code = NO_KILLING;
  1069. X  #ifdef SIGTSTP
  1070. X      void (*susp)();
  1071. X  
  1072. X--- 192,205 ----
  1073. X      int kill_at_once;
  1074. X  {
  1075. X      char *str;
  1076. X!     int ch, i;
  1077. X      int kill_changed = FALSE;
  1078. X      int orig_kill_state;
  1079. X+     int orig_show_only_unread;
  1080. X+     int orig_thread_arts;
  1081. X      int option;
  1082. X      int ret_code = NO_KILLING;
  1083. X+     
  1084. X  #ifdef SIGTSTP
  1085. X      void (*susp)();
  1086. X  
  1087. X***************
  1088. X*** 199,204 ****
  1089. X--- 215,224 ----
  1090. X      }
  1091. X  #endif
  1092. X  
  1093. X+     COL1 = 0;
  1094. X+     COL2 = ((COLS / 3) * 1) + 1;
  1095. X+     COL3 = ((COLS / 3) * 2) + 2;
  1096. X+ 
  1097. X      show_rcfile_menu ();
  1098. X  
  1099. X      while (1) {
  1100. X***************
  1101. X*** 220,226 ****
  1102. X          if (ch >= '1' && ch <= '9') {
  1103. X              option = parse_num (ch, "Enter option number> ");
  1104. X          } else {
  1105. X!             option = 0;
  1106. X          }
  1107. X  #ifdef SIGTSTP
  1108. X          if (do_sigtstp) {
  1109. X--- 240,250 ----
  1110. X          if (ch >= '1' && ch <= '9') {
  1111. X              option = parse_num (ch, "Enter option number> ");
  1112. X          } else {
  1113. X!             if (ch == 'q' || ch == ESC) {
  1114. X!                 option = -1;
  1115. X!             } else {
  1116. X!                 option = 0;
  1117. X!             }
  1118. X          }
  1119. X  #ifdef SIGTSTP
  1120. X          if (do_sigtstp) {
  1121. X***************
  1122. X*** 235,240 ****
  1123. X--- 259,267 ----
  1124. X          }
  1125. X  #endif
  1126. X          switch (option) {
  1127. X+             case -1:
  1128. X+                 return ret_code;
  1129. X+                 /*NOTREACHED*/                
  1130. X              case 0:
  1131. X                  write_rcfile ();
  1132. X                  if (kill_changed) {
  1133. X***************
  1134. X*** 266,304 ****
  1135. X                  return ret_code;
  1136. X              
  1137. X              case 1:        /* auto save */
  1138. X!                 show_menu_help (txt_help_autosave);
  1139. X!                 do {
  1140. X!                     MoveCursor (INDEX_TOP, (int) strlen (txt_opt_autosave));
  1141. X!                     if ((ch = ReadCh()) == ' ') {
  1142. X!                         save_archive_name = !save_archive_name;
  1143. X!                         printf ("%s", (save_archive_name ? "ON " : "OFF"));
  1144. X!                         fflush(stdout);
  1145. X!                     }
  1146. X!                 } while (ch != CR && ch != ESC);
  1147. X                  break;
  1148. X  
  1149. X              case 2:        /* save sperate */
  1150. X!                 show_menu_help (txt_help_save_separate);
  1151. X!                 do {
  1152. X!                     MoveCursor (INDEX_TOP, COL2 + (int) strlen (txt_opt_save_separate));
  1153. X!                     if ((ch = ReadCh()) == ' ') {
  1154. X!                         save_separate = !save_separate;
  1155. X!                         printf ("%s", (save_separate ? "ON " : "OFF"));
  1156. X!                         fflush(stdout);
  1157. X!                     }
  1158. X!                 } while (ch != CR && ch != ESC);
  1159. X                  break;
  1160. X              
  1161. X              case 3:        /* mark saved articles read */
  1162. X!                 show_menu_help (txt_help_mark_saved_read);
  1163. X!                 do {
  1164. X!                     MoveCursor (INDEX_TOP+2, (int) strlen (txt_opt_mark_saved_read));
  1165. X!                     if ((ch = ReadCh()) == ' ') {
  1166. X!                         mark_saved_read = !mark_saved_read;
  1167. X!                         printf ("%s", (mark_saved_read ? "ON " : "OFF"));
  1168. X!                         fflush(stdout);
  1169. X!                     }
  1170. X!                 } while (ch != CR && ch != ESC);
  1171. X                  break;
  1172. X  
  1173. X              case 4:        /* kill articles */
  1174. X--- 293,310 ----
  1175. X                  return ret_code;
  1176. X              
  1177. X              case 1:        /* auto save */
  1178. X!                 prompt_on_off (INDEX_TOP, COL1, &save_archive_name, 
  1179. X!                     txt_help_autosave, txt_opt_autosave);
  1180. X                  break;
  1181. X  
  1182. X              case 2:        /* save sperate */
  1183. X!                 prompt_on_off (INDEX_TOP, COL2, &save_separate, 
  1184. X!                     txt_help_save_separate, txt_opt_save_separate);
  1185. X                  break;
  1186. X              
  1187. X              case 3:        /* mark saved articles read */
  1188. X!                 prompt_on_off (INDEX_TOP, COL3, &mark_saved_read, 
  1189. X!                     txt_help_mark_saved_read, txt_opt_mark_saved_read);
  1190. X                  break;
  1191. X  
  1192. X              case 4:        /* kill articles */
  1193. X***************
  1194. X*** 305,377 ****
  1195. X                  orig_kill_state = kill_articles;
  1196. X                  show_menu_help (txt_help_kill_articles);
  1197. X                  do {
  1198. X!                     MoveCursor (INDEX_TOP+2, COL2 + (int) strlen (txt_opt_kill_articles));
  1199. X                      if ((ch = ReadCh()) == ' ') {
  1200. X                          kill_articles = !kill_articles;
  1201. X                          kill_changed = (kill_articles != orig_kill_state ? TRUE : FALSE);
  1202. X                          printf ("%s", (kill_articles ? "ON " : "OFF"));
  1203. X!                         fflush(stdout);
  1204. X                      }
  1205. X                  } while (ch != CR && ch != ESC);
  1206. X                  break;
  1207. X  
  1208. X!             case 5:        /* show subject & author / subject only */
  1209. X!                 show_menu_help (txt_help_show_author);
  1210. X!                 do {
  1211. X!                     MoveCursor (INDEX_TOP+4, (int) strlen (txt_opt_show_author));
  1212. X!                     if ((ch = ReadCh()) == ' ') {
  1213. X!                         show_author = !show_author;
  1214. X!                         printf ("%s", (show_author ? "ON " : "OFF"));
  1215. X!                         fflush(stdout);    
  1216. X!                     }
  1217. X!                 } while (ch != CR && ch != ESC);
  1218. X!                 break;
  1219. X!             
  1220. X!             case 6:        /* draw -> / highlighted bar */
  1221. X!                 show_menu_help (txt_help_draw_arrow);
  1222. X!                 do {
  1223. X!                     MoveCursor (INDEX_TOP+4, COL2 + (int) strlen (txt_opt_draw_arrow));
  1224. X!                     if ((ch = ReadCh()) == ' ') {
  1225. X!                         draw_arrow_mark = !draw_arrow_mark;
  1226. X!                         printf ("%s", (draw_arrow_mark ? "ON " : "OFF"));
  1227. X!                         fflush(stdout);
  1228. X!                     }
  1229. X!                 } while (ch != CR && ch != ESC);
  1230. X                  if (draw_arrow_mark == FALSE && inverse_okay == FALSE) {
  1231. X                      inverse_okay = TRUE;
  1232. X                  }
  1233. X                  break;
  1234. X  
  1235. X!             case 7:        /* print header */
  1236. X!                 show_menu_help (txt_help_print_header);
  1237. X!                 do {
  1238. X!                     MoveCursor (INDEX_TOP+6, (int) strlen (txt_opt_print_header));
  1239. X!                     if ((ch = ReadCh()) == ' ') {
  1240. X!                         print_header = !print_header;
  1241. X!                         printf ("%s", (print_header ? "ON " : "OFF"));
  1242. X!                         fflush(stdout);
  1243. X!                     }
  1244. X!                 } while (ch != CR && ch != ESC);
  1245. X                  break;
  1246. X              
  1247. X!             case 8:        /* position cursor at first / last unread art */
  1248. X!                 show_menu_help (txt_help_pos_first_unread);
  1249. X                  do {
  1250. X!                     MoveCursor (INDEX_TOP+6, COL2 + (int) strlen (txt_opt_pos_first_unread));
  1251. X!                     if ((ch = ReadCh()) == ' ') {
  1252. X!                         pos_first_unread = !pos_first_unread;
  1253. X!                         printf ("%s", (pos_first_unread ? "ON " : "OFF"));
  1254. X                          fflush(stdout);
  1255. X                      }
  1256. X                  } while (ch != CR && ch != ESC);
  1257. X                  break;
  1258. X  
  1259. X!             case 9:
  1260. X                  show_menu_help (txt_help_post_proc_type);
  1261. X                  do {
  1262. X!                     MoveCursor (INDEX_TOP+8, (int) strlen (txt_opt_process_type));
  1263. X                      if ((ch    = ReadCh()) == ' ') {
  1264. X!                         if (post_proc_type + 1 > POST_PROC_PATCH) {
  1265. X                              post_proc_type = POST_PROC_NONE;
  1266. X                          } else {
  1267. X                              post_proc_type++;
  1268. X--- 311,431 ----
  1269. X                  orig_kill_state = kill_articles;
  1270. X                  show_menu_help (txt_help_kill_articles);
  1271. X                  do {
  1272. X!                     MoveCursor (INDEX_TOP+2, COL1 + (int) strlen (txt_opt_kill_articles));
  1273. X                      if ((ch = ReadCh()) == ' ') {
  1274. X                          kill_articles = !kill_articles;
  1275. X                          kill_changed = (kill_articles != orig_kill_state ? TRUE : FALSE);
  1276. X                          printf ("%s", (kill_articles ? "ON " : "OFF"));
  1277. X!                         fflush (stdout);
  1278. X                      }
  1279. X                  } while (ch != CR && ch != ESC);
  1280. X                  break;
  1281. X  
  1282. X!             case 5:        /* draw -> / highlighted bar */
  1283. X!                 prompt_on_off (INDEX_TOP+2, COL2, &draw_arrow_mark, 
  1284. X!                     txt_help_draw_arrow, txt_opt_draw_arrow);
  1285. X                  if (draw_arrow_mark == FALSE && inverse_okay == FALSE) {
  1286. X                      inverse_okay = TRUE;
  1287. X                  }
  1288. X                  break;
  1289. X  
  1290. X!             case 6:        /* print header */
  1291. X!                 prompt_on_off (INDEX_TOP+2, COL3, &print_header, 
  1292. X!                     txt_help_print_header, txt_opt_print_header);
  1293. X                  break;
  1294. X              
  1295. X!             case 7:        /* position cursor at first / last unread art */
  1296. X!                 prompt_on_off (INDEX_TOP+4, COL1, &pos_first_unread, 
  1297. X!                     txt_help_pos_first_unread, txt_opt_pos_first_unread);
  1298. X!                 break;
  1299. X! 
  1300. X!             case 8:        /* scroll half/full page of groups/articles */
  1301. X!                 prompt_on_off (INDEX_TOP+4, COL2, &full_page_scroll, 
  1302. X!                     txt_help_page_scroll, txt_opt_page_scroll);
  1303. X!                 break;
  1304. X! 
  1305. X!             case 9:        /* catchup read groups when quitting */
  1306. X!                 prompt_on_off (INDEX_TOP+4, COL3, &catchup_read_groups, 
  1307. X!                     txt_help_catchup_groups, txt_opt_catchup_groups);
  1308. X!                 break;
  1309. X! 
  1310. X!             case 10:    /* thread/unthread all groups except those in ~/.tin/unthreaded */
  1311. X!                 orig_thread_arts = thread_arts;    
  1312. X!                 prompt_on_off (INDEX_TOP+6, COL1, &thread_arts, 
  1313. X!                     txt_help_thread_arts, txt_opt_thread_arts);
  1314. X!                 if (thread_arts != orig_thread_arts || group != (char *) 0) {
  1315. X!                     make_threads (TRUE);
  1316. X!                     find_base (show_only_unread);
  1317. X!                 }
  1318. X!                 break;
  1319. X! 
  1320. X!             case 11:    /* show all arts or just new/unread arts */
  1321. X!                 orig_show_only_unread = show_only_unread;    
  1322. X!                 prompt_on_off (INDEX_TOP+6, COL2, &show_only_unread, 
  1323. X!                     txt_help_show_only_unread, txt_opt_show_only_unread);
  1324. X!                 if (show_only_unread != orig_show_only_unread || group != (char *) 0) {
  1325. X!                     make_threads (TRUE);
  1326. X!                     find_base (show_only_unread);
  1327. X!                     if (space_mode) {
  1328. X!                         for (i = 0; i < top_base; i++) {
  1329. X!                             if (new_responses (i)) {
  1330. X!                                 break;
  1331. X!                             }
  1332. X!                         }
  1333. X!                         if (i < top_base) {
  1334. X!                             index_point = i;
  1335. X!                         } else {
  1336. X!                             index_point = top_base - 1;
  1337. X!                         }
  1338. X!                     } else {
  1339. X!                         index_point = top_base - 1;
  1340. X!                     }
  1341. X!                 }
  1342. X!                 break;
  1343. X! 
  1344. X!             case 13:        /* show subject & author / subject only */
  1345. X!                 show_menu_help (txt_help_show_author);
  1346. X                  do {
  1347. X!                     MoveCursor (INDEX_TOP+8, COL1 + (int) strlen (txt_opt_show_author));
  1348. X!                     if ((ch    = ReadCh()) == ' ') {
  1349. X!                         if (show_author + 1 > SHOW_FROM_BOTH) {
  1350. X!                             show_author = SHOW_FROM_NONE;
  1351. X!                         } else {
  1352. X!                             show_author++;
  1353. X!                         }
  1354. X!                         switch (show_author) {
  1355. X!                             case SHOW_FROM_NONE:
  1356. X!                                 str = txt_show_from_none;
  1357. X!                                 break;
  1358. X!                             case SHOW_FROM_ADDR:
  1359. X!                                 str = txt_show_from_addr;
  1360. X!                                 break;
  1361. X!                             case SHOW_FROM_NAME:
  1362. X!                                 str = txt_show_from_name;
  1363. X!                                 break;
  1364. X!                             case SHOW_FROM_BOTH:
  1365. X!                                 str = txt_show_from_both;
  1366. X!                                 break;
  1367. X!                         }
  1368. X!                         printf ("%s", str);
  1369. X                          fflush(stdout);
  1370. X                      }
  1371. X                  } while (ch != CR && ch != ESC);
  1372. X+                 if (show_author == SHOW_FROM_ADDR ||
  1373. X+                     show_author == SHOW_FROM_BOTH) {
  1374. X+                     max_subj = (COLS / 2) - 2;
  1375. X+                 } else {
  1376. X+                     max_subj = (COLS / 2) + 5;
  1377. X+                 }
  1378. X+                 max_from = (COLS - max_subj) - 17;
  1379. X                  break;
  1380. X  
  1381. X!             case 14:
  1382. X                  show_menu_help (txt_help_post_proc_type);
  1383. X                  do {
  1384. X!                     MoveCursor (INDEX_TOP+8, COL2 + (int) strlen (txt_opt_process_type));
  1385. X                      if ((ch    = ReadCh()) == ' ') {
  1386. X!                         if (post_proc_type + 1 > POST_PROC_UUD_EXT_ZOO) {
  1387. X                              post_proc_type = POST_PROC_NONE;
  1388. X                          } else {
  1389. X                              post_proc_type++;
  1390. X***************
  1391. X*** 397,406 ****
  1392. X                                  str = txt_post_process_uud_ext_zoo;
  1393. X                                  proc_ch_default = 'U';
  1394. X                                  break;
  1395. X-                             case POST_PROC_PATCH:
  1396. X-                                 str = txt_post_process_patch;
  1397. X-                                 proc_ch_default = 'p';
  1398. X-                                 break;
  1399. X                          }
  1400. X                          CleartoEOLN (); 
  1401. X                          printf ("%s", str);
  1402. X--- 451,456 ----
  1403. X***************
  1404. X*** 408,417 ****
  1405. X                      }
  1406. X                  } while (ch != CR && ch != ESC);
  1407. X                  break;
  1408. X!             case 10:
  1409. X                  show_menu_help (txt_help_sort_type);
  1410. X                  do {
  1411. X!                     MoveCursor (INDEX_TOP+10, (int) strlen (txt_opt_sort_type));
  1412. X                      if ((ch    = ReadCh()) == ' ') {
  1413. X                          if (sort_art_type + 1 > SORT_BY_DATE_ASCEND) {
  1414. X                              sort_art_type = SORT_BY_NOTHING;
  1415. X--- 458,468 ----
  1416. X                      }
  1417. X                  } while (ch != CR && ch != ESC);
  1418. X                  break;
  1419. X! 
  1420. X!             case 15:
  1421. X                  show_menu_help (txt_help_sort_type);
  1422. X                  do {
  1423. X!                     MoveCursor (INDEX_TOP+10, COL1 + (int) strlen (txt_opt_sort_type));
  1424. X                      if ((ch    = ReadCh()) == ' ') {
  1425. X                          if (sort_art_type + 1 > SORT_BY_DATE_ASCEND) {
  1426. X                              sort_art_type = SORT_BY_NOTHING;
  1427. X***************
  1428. X*** 447,466 ****
  1429. X                      }
  1430. X                  } while (ch != CR && ch != ESC);
  1431. X                  break;
  1432. X!             case 11:
  1433. X                  show_menu_help (txt_help_savedir);
  1434. X!                 parse_menu_string (INDEX_TOP+12, (int) strlen (txt_opt_savedir), savedir);
  1435. X!                 expand_rel_abs_pathname (INDEX_TOP+12, (int) strlen (txt_opt_savedir), savedir);
  1436. X                  break;
  1437. X!             case 12:
  1438. X                  show_menu_help (txt_help_maildir);
  1439. X!                 parse_menu_string (INDEX_TOP+14, (int) strlen (txt_opt_maildir), maildir);
  1440. X!                 expand_rel_abs_pathname (INDEX_TOP+14, (int) strlen (txt_opt_maildir), maildir);
  1441. X                  break;
  1442. X!             case 13:
  1443. X                  show_menu_help (txt_help_printer);
  1444. X!                 parse_menu_string (INDEX_TOP+16, (int) strlen (txt_opt_printer), printer);
  1445. X!                 expand_rel_abs_pathname (INDEX_TOP+16, (int) strlen (txt_opt_printer), printer);
  1446. X                  break;
  1447. X          }
  1448. X          show_menu_help (txt_select_rcfile_option);
  1449. X--- 498,520 ----
  1450. X                      }
  1451. X                  } while (ch != CR && ch != ESC);
  1452. X                  break;
  1453. X! 
  1454. X!             case 16:
  1455. X                  show_menu_help (txt_help_savedir);
  1456. X!                 parse_menu_string (INDEX_TOP+12, COL1 + (int) strlen (txt_opt_savedir), savedir);
  1457. X!                 expand_rel_abs_pathname (INDEX_TOP+12, COL1 + (int) strlen (txt_opt_savedir), savedir);
  1458. X                  break;
  1459. X! 
  1460. X!             case 17:
  1461. X                  show_menu_help (txt_help_maildir);
  1462. X!                 parse_menu_string (INDEX_TOP+14, COL1 + (int) strlen (txt_opt_maildir), maildir);
  1463. X!                 expand_rel_abs_pathname (INDEX_TOP+14, COL1 + (int) strlen (txt_opt_maildir), maildir);
  1464. X                  break;
  1465. X! 
  1466. X!             case 18:
  1467. X                  show_menu_help (txt_help_printer);
  1468. X!                 parse_menu_string (INDEX_TOP+16, COL1 + (int) strlen (txt_opt_printer), printer);
  1469. X!                 expand_rel_abs_pathname (INDEX_TOP+16, COL1 + (int) strlen (txt_opt_printer), printer);
  1470. X                  break;
  1471. X          }
  1472. X          show_menu_help (txt_select_rcfile_option);
  1473. X***************
  1474. X*** 478,497 ****
  1475. X      
  1476. X      MoveCursor (INDEX_TOP, 0);
  1477. X      printf ("%s%s\r\n\r\n", txt_opt_autosave, (save_archive_name ? "ON " : "OFF"));
  1478. X!     printf ("%s%s\r\n\r\n", txt_opt_mark_saved_read, (mark_saved_read ? "ON " : "OFF"));
  1479. X!     printf ("%s%s\r\n\r\n", txt_opt_show_author, (show_author ? "ON " : "OFF"));
  1480. X!     printf ("%s%s", txt_opt_print_header, (print_header ? "ON " : "OFF"));
  1481. X  
  1482. X      MoveCursor(INDEX_TOP, COL2);
  1483. X      printf ("%s%s", txt_opt_save_separate, (save_separate ? "ON " : "OFF"));
  1484. X      MoveCursor(INDEX_TOP+2, COL2);
  1485. X-     printf ("%s%s", txt_opt_kill_articles, (kill_articles ? "ON " : "OFF"));
  1486. X-     MoveCursor(INDEX_TOP+4, COL2);
  1487. X      printf ("%s%s", txt_opt_draw_arrow, (draw_arrow_mark ? "ON " : "OFF"));
  1488. X      MoveCursor(INDEX_TOP+6, COL2);
  1489. X!     printf ("%s%s", txt_opt_pos_first_unread, (pos_first_unread ? "ON " : "OFF"));
  1490. X  
  1491. X!     MoveCursor(INDEX_TOP+8, 0);
  1492. X      switch (post_proc_type) {
  1493. X          case POST_PROC_NONE:
  1494. X              str = txt_post_process_none;
  1495. X--- 532,574 ----
  1496. X      
  1497. X      MoveCursor (INDEX_TOP, 0);
  1498. X      printf ("%s%s\r\n\r\n", txt_opt_autosave, (save_archive_name ? "ON " : "OFF"));
  1499. X!     printf ("%s%s\r\n\r\n", txt_opt_kill_articles, (kill_articles ? "ON " : "OFF"));
  1500. X!     printf ("%s%s\r\n\r\n", txt_opt_pos_first_unread, (pos_first_unread ? "ON " : "OFF"));
  1501. X!     printf ("%s%s", txt_opt_thread_arts, (thread_arts ? "ON " : "OFF"));
  1502. X  
  1503. X      MoveCursor(INDEX_TOP, COL2);
  1504. X      printf ("%s%s", txt_opt_save_separate, (save_separate ? "ON " : "OFF"));
  1505. X      MoveCursor(INDEX_TOP+2, COL2);
  1506. X      printf ("%s%s", txt_opt_draw_arrow, (draw_arrow_mark ? "ON " : "OFF"));
  1507. X+     MoveCursor(INDEX_TOP+4, COL2);
  1508. X+     printf ("%s%s", txt_opt_page_scroll, (full_page_scroll ? "ON " : "OFF"));
  1509. X      MoveCursor(INDEX_TOP+6, COL2);
  1510. X!     printf ("%s%s", txt_opt_show_only_unread, (show_only_unread ? "ON " : "OFF"));
  1511. X  
  1512. X!     MoveCursor(INDEX_TOP, COL3);
  1513. X!     printf ("%s%s", txt_opt_mark_saved_read, (mark_saved_read ? "ON " : "OFF"));
  1514. X!     MoveCursor(INDEX_TOP+2, COL3);
  1515. X!     printf ("%s%s", txt_opt_print_header, (print_header ? "ON " : "OFF"));
  1516. X!     MoveCursor(INDEX_TOP+4, COL3);
  1517. X!     printf ("%s%s", txt_opt_catchup_groups, (catchup_read_groups ? "ON " : "OFF"));
  1518. X! 
  1519. X!     MoveCursor(INDEX_TOP+8, COL1);
  1520. X!     switch (show_author) {
  1521. X!         case SHOW_FROM_NONE:
  1522. X!             str = txt_show_from_none;
  1523. X!             break;
  1524. X!         case SHOW_FROM_ADDR:
  1525. X!             str = txt_show_from_addr;
  1526. X!             break;
  1527. X!         case SHOW_FROM_NAME:
  1528. X!             str = txt_show_from_name;
  1529. X!             break;
  1530. X!         case SHOW_FROM_BOTH:
  1531. X!             str = txt_show_from_both;
  1532. X!             break;
  1533. X!         }
  1534. X!     printf ("%s%s", txt_opt_show_author, str);
  1535. X!     MoveCursor(INDEX_TOP+8, COL2);
  1536. X      switch (post_proc_type) {
  1537. X          case POST_PROC_NONE:
  1538. X              str = txt_post_process_none;
  1539. X***************
  1540. X*** 508,520 ****
  1541. X          case POST_PROC_UUD_EXT_ZOO:
  1542. X              str = txt_post_process_uud_ext_zoo;
  1543. X              break;
  1544. X-         case POST_PROC_PATCH:
  1545. X-             str = txt_post_process_patch;
  1546. X-             break;
  1547. X      }
  1548. X      printf ("%s%s\r\n\r\n", txt_opt_process_type, str);
  1549. X      
  1550. X!     MoveCursor(INDEX_TOP+10, 0);
  1551. X      switch (sort_art_type) {
  1552. X          case SORT_BY_NOTHING:
  1553. X              str = txt_sort_by_nothing;
  1554. X--- 585,594 ----
  1555. X          case POST_PROC_UUD_EXT_ZOO:
  1556. X              str = txt_post_process_uud_ext_zoo;
  1557. X              break;
  1558. X      }
  1559. X      printf ("%s%s\r\n\r\n", txt_opt_process_type, str);
  1560. X      
  1561. X!     MoveCursor(INDEX_TOP+10, COL1);
  1562. X      switch (sort_art_type) {
  1563. X          case SORT_BY_NOTHING:
  1564. X              str = txt_sort_by_nothing;
  1565. X***************
  1566. X*** 547,552 ****
  1567. X--- 621,647 ----
  1568. X  
  1569. X      show_menu_help (txt_select_rcfile_option);
  1570. X      MoveCursor (LINES, 0);
  1571. X+ }
  1572. X+ 
  1573. X+ 
  1574. X+ void prompt_on_off (row, col, var, help_text, prompt_text)
  1575. X+     int row;
  1576. X+     int col;
  1577. X+     int *var;
  1578. X+     char *help_text;
  1579. X+     char *prompt_text;
  1580. X+ {
  1581. X+     int ch;
  1582. X+ 
  1583. X+     show_menu_help (help_text);
  1584. X+     do {
  1585. X+         MoveCursor (row, col + (int) strlen (prompt_text));
  1586. X+         if ((ch = ReadCh()) == ' ') {
  1587. X+             *var = !*var;
  1588. X+             printf ("%s", (*var ? "ON " : "OFF"));
  1589. X+             fflush (stdout);
  1590. X+         }
  1591. X+     } while (ch != CR && ch != ESC);
  1592. X  }
  1593. X  
  1594. X  /*
  1595. Xdiff -rcs ../105/save.c ./save.c
  1596. X*** ../105/save.c    Thu Oct 10 20:48:47 1991
  1597. X--- ./save.c    Mon Oct 28 20:18:44 1991
  1598. X***************
  1599. X*** 3,9 ****
  1600. X   *  Module    : save.c
  1601. X   *  Author    : R.Skrenta / I.Lea
  1602. X   *  Created   : 01-04-91
  1603. X!  *  Updated   : 10-10-91
  1604. X   *  Release   : 1.0
  1605. X   *  Notes     :
  1606. X   *  Copyright : (c) Copyright 1991 by Rich Skrenta, Iain Lea
  1607. X--- 3,9 ----
  1608. X   *  Module    : save.c
  1609. X   *  Author    : R.Skrenta / I.Lea
  1610. X   *  Created   : 01-04-91
  1611. X!  *  Updated   : 28-10-91
  1612. X   *  Release   : 1.0
  1613. X   *  Notes     :
  1614. X   *  Copyright : (c) Copyright 1991 by Rich Skrenta, Iain Lea
  1615. X***************
  1616. X*** 112,118 ****
  1617. X      
  1618. X      set_tin_uid_gid ();
  1619. X  
  1620. X!     if (! filename) {
  1621. X          if (is_mailbox) {
  1622. X              sprintf (save_art_info, txt_saved_to_mailbox, get_first_savefile ());
  1623. X          } else {
  1624. X--- 112,118 ----
  1625. X      
  1626. X      set_tin_uid_gid ();
  1627. X  
  1628. X!     if (filename == (char *) 0) {
  1629. X          if (is_mailbox) {
  1630. X              sprintf (save_art_info, txt_saved_to_mailbox, get_first_savefile ());
  1631. X          } else {
  1632. X***************
  1633. X*** 188,195 ****
  1634. X                          first_savefile);
  1635. X                  }
  1636. X              }
  1637. X!             free (first_savefile);
  1638. X!             first_savefile = (char *) 0;
  1639. X          }
  1640. X          info_message (save_thread_info);
  1641. X      }
  1642. X--- 188,197 ----
  1643. X                          first_savefile);
  1644. X                  }
  1645. X              }
  1646. X!             if (first_savefile != (char *) 0) {
  1647. X!                 free (first_savefile);
  1648. X!                 first_savefile = (char *) 0;
  1649. X!             }
  1650. X          }
  1651. X          info_message (save_thread_info);
  1652. X      }
  1653. X***************
  1654. X*** 249,261 ****
  1655. X          if (stat(file, &st) != -1) {    
  1656. X              sprintf (buf, txt_append_to_file, file); 
  1657. X              if (! prompt_yn (LINES, buf, 'n')) {
  1658. X!                 free (file);
  1659. X!                 file = NULL;
  1660. X                  return FALSE;
  1661. X              }
  1662. X          }
  1663. X!         free (file);
  1664. X!         file = NULL;
  1665. X      }
  1666. X      
  1667. X      return TRUE;
  1668. X--- 251,267 ----
  1669. X          if (stat(file, &st) != -1) {    
  1670. X              sprintf (buf, txt_append_to_file, file); 
  1671. X              if (! prompt_yn (LINES, buf, 'n')) {
  1672. X!                 if (file != (char *) 0) {
  1673. X!                     free (file);
  1674. X!                     file = (char *) 0;
  1675. X!                 }
  1676. X                  return FALSE;
  1677. X              }
  1678. X          }
  1679. X!         if (file != (char *) 0) {
  1680. X!             free (file);
  1681. X!             file = (char *) 0;
  1682. X!         }
  1683. X      }
  1684. X      
  1685. X      return TRUE;
  1686. X***************
  1687. X*** 404,410 ****
  1688. X          } else {
  1689. X              strcpy (file, glob_group);
  1690. X          }
  1691. X!         save[save_num].dir = maildir;
  1692. X          save[save_num].file = str_dup (file);
  1693. X      } else {
  1694. X          if (path[0]) {
  1695. X--- 410,416 ----
  1696. X          } else {
  1697. X              strcpy (file, glob_group);
  1698. X          }
  1699. X!         save[save_num].dir = str_dup (maildir);
  1700. X          save[save_num].file = str_dup (file);
  1701. X      } else {
  1702. X          if (path[0]) {
  1703. X***************
  1704. X*** 430,436 ****
  1705. X              if (path[0]) {
  1706. X                  save[save_num].file = str_dup (path);
  1707. X              } else {
  1708. X!                 save[save_num].file = save[save_num].archive;
  1709. X              }
  1710. X          }
  1711. X      }
  1712. X--- 436,442 ----
  1713. X              if (path[0]) {
  1714. X                  save[save_num].file = str_dup (path);
  1715. X              } else {
  1716. X!                 save[save_num].file = str_dup (save[save_num].archive);
  1717. X              }
  1718. X          }
  1719. X      }
  1720. X***************
  1721. X*** 618,627 ****
  1722. X                      post_process_uud (POST_PROC_UUD_LST_ZOO);
  1723. X                  }
  1724. X                  break;
  1725. X- 
  1726. X-             case 'p':
  1727. X-                 post_process_patch ();
  1728. X-                 break;
  1729. X          }
  1730. X  
  1731. X          info_message (txt_post_processing_finished);
  1732. X--- 624,629 ----
  1733. X***************
  1734. X*** 767,774 ****
  1735. X                  printf ("%s  %8d bytes\r\n", buf, file_size); 
  1736. X                  fflush (stdout);
  1737. X              }
  1738. X!             free (file);
  1739. X!             file = (char *) 0;
  1740. X          }
  1741. X      }
  1742. X  
  1743. X--- 769,778 ----
  1744. X                  printf ("%s  %8d bytes\r\n", buf, file_size); 
  1745. X                  fflush (stdout);
  1746. X              }
  1747. X!             if (file != (char *) 0) {
  1748. X!                 free (file);
  1749. X!                 file = (char *) 0;
  1750. X!             }
  1751. X          }
  1752. X      }
  1753. X  
  1754. X***************
  1755. X*** 787,794 ****
  1756. X                  printf ("\r\n\r\nExtracting %s archive...\r\n", file);
  1757. X              }
  1758. X              fflush (stdout);
  1759. X!             free (file);
  1760. X!             file = (char *) 0;
  1761. X              if (! invoke_cmd (buf)) {
  1762. X                  set_real_uid_gid ();
  1763. X                  error_message ("Post processing failed", "");
  1764. X--- 791,800 ----
  1765. X                  printf ("\r\n\r\nExtracting %s archive...\r\n", file);
  1766. X              }
  1767. X              fflush (stdout);
  1768. X!             if (file != (char *) 0) {
  1769. X!                 free (file);
  1770. X!                 file = (char *) 0;
  1771. X!             }
  1772. X              if (! invoke_cmd (buf)) {
  1773. X                  set_real_uid_gid ();
  1774. X                  error_message ("Post processing failed", "");
  1775. X***************
  1776. X*** 812,822 ****
  1777. X      char file_out[LEN];
  1778. X      char file_out_dir[LEN];
  1779. X      char *ptr1, *ptr2;
  1780. X      FILE *fp_in, *fp_out;
  1781. X      int found_header;
  1782. X      int i, j;
  1783. X!     char sh_pattern_1[16];
  1784. X!     char sh_pattern_2[16];
  1785. X  
  1786. X      strcpy (sh_pattern_1, "#! /bin/sh");
  1787. X      strcpy (sh_pattern_2, "#!/bin/sh");
  1788. X--- 818,829 ----
  1789. X      char file_out[LEN];
  1790. X      char file_out_dir[LEN];
  1791. X      char *ptr1, *ptr2;
  1792. X+     char sh_pattern_1[16];
  1793. X+     char sh_pattern_2[16];
  1794. X      FILE *fp_in, *fp_out;
  1795. X      int found_header;
  1796. X      int i, j;
  1797. X!     int patlen1, patlen2;
  1798. X  
  1799. X      strcpy (sh_pattern_1, "#! /bin/sh");
  1800. X      strcpy (sh_pattern_2, "#!/bin/sh");
  1801. X***************
  1802. X*** 841,846 ****
  1803. X--- 848,857 ----
  1804. X          
  1805. X          if ((fp_out = fopen (file_out, "w")) != NULL) {
  1806. X              if ((fp_in = fopen (file_in, "r")) != NULL) {
  1807. X+                 ptr1 = sh_pattern_1;
  1808. X+                 ptr2 = sh_pattern_2;
  1809. X+                 patlen1 = strlen (sh_pattern_1);
  1810. X+                 patlen2 = strlen (sh_pattern_2);
  1811. X                  while (! feof (fp_in)) {
  1812. X                      if (fgets (buf, sizeof buf, fp_in)) {
  1813. X                          /*
  1814. X***************
  1815. X*** 847,856 ****
  1816. X                           *  find #!/bin/sh or #! /bin/sh pattern
  1817. X                           */
  1818. X                          if (!found_header) {
  1819. X!                             ptr1 = sh_pattern_1;
  1820. X!                             ptr2 = sh_pattern_2;
  1821. X!                             if (str_str (buf, ptr1) != 0 ||
  1822. X!                                 str_str (buf, ptr2) != 0) {
  1823. X                                  found_header = TRUE;
  1824. X                              }
  1825. X                          }
  1826. X--- 858,865 ----
  1827. X                           *  find #!/bin/sh or #! /bin/sh pattern
  1828. X                           */
  1829. X                          if (!found_header) {
  1830. X!                             if (str_str (buf, ptr1, patlen1) != 0 ||
  1831. X!                                 str_str (buf, ptr2, patlen2) != 0) {
  1832. X                                  found_header = TRUE;
  1833. X                              }
  1834. X                          }
  1835. X***************
  1836. X*** 920,928 ****
  1837. X              unlink (save_filename (i));
  1838. X          }
  1839. X      }
  1840. X- }
  1841. X- 
  1842. X- 
  1843. X- void post_process_patch ()
  1844. X- {
  1845. X  }
  1846. X--- 929,932 ----
  1847. Xdiff -rcs ../105/screen.c ./screen.c
  1848. X*** ../105/screen.c    Fri Oct  4 08:05:05 1991
  1849. X--- ./screen.c    Thu Oct 31 19:17:34 1991
  1850. X***************
  1851. X*** 3,9 ****
  1852. X   *  Module    : screen.c
  1853. X   *  Author    : R.Skrenta / I.Lea
  1854. X   *  Created   : 01-04-91
  1855. X!  *  Updated   : 04-10-91
  1856. X   *  Release   : 1.0
  1857. X   *  Notes     :
  1858. X   *  Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
  1859. X--- 3,9 ----
  1860. X   *  Module    : screen.c
  1861. X   *  Author    : R.Skrenta / I.Lea
  1862. X   *  Created   : 01-04-91
  1863. X!  *  Updated   : 31-10-91
  1864. X   *  Release   : 1.0
  1865. X   *  Notes     :
  1866. X   *  Copyright : (c) Copyright 1991 by Rich Skrenta & Iain Lea
  1867. X***************
  1868. X*** 24,32 ****
  1869. X  void info_message (str)
  1870. X      char *str;
  1871. X  {
  1872. X!     clear_message();                /* Clear any old messages hanging around */
  1873. X!     center_line(LINES, FALSE, str);    /* center the message at screen bottom */
  1874. X!     MoveCursor(LINES, 0);
  1875. X  }
  1876. X  
  1877. X  
  1878. X--- 24,34 ----
  1879. X  void info_message (str)
  1880. X      char *str;
  1881. X  {
  1882. X!     clear_message ();                /* Clear any old messages hanging around */
  1883. X!     center_line (LINES, FALSE, str);    /* center the message at screen bottom */
  1884. X!     if (RawState ()) {
  1885. X!         MoveCursor (LINES, 0);
  1886. X!     }
  1887. X  }
  1888. X  
  1889. X  
  1890. X***************
  1891. X*** 47,53 ****
  1892. X  {
  1893. X      errno = 0;
  1894. X  
  1895. X!     if (update == FALSE && RawState ()) {
  1896. X          clear_message ();      /* Clear any old messages hanging around */
  1897. X      }
  1898. X      
  1899. X--- 49,55 ----
  1900. X  {
  1901. X      errno = 0;
  1902. X  
  1903. X!     if (RawState ()) {
  1904. X          clear_message ();      /* Clear any old messages hanging around */
  1905. X      }
  1906. X      
  1907. X***************
  1908. X*** 54,60 ****
  1909. X      fprintf (stderr, template, str);
  1910. X      fflush (stderr);
  1911. X  
  1912. X!     if (update == FALSE && RawState ()) {
  1913. X          MoveCursor (LINES, 0);
  1914. X          sleep (2);
  1915. X      } else {
  1916. X--- 56,62 ----
  1917. X      fprintf (stderr, template, str);
  1918. X      fflush (stderr);
  1919. X  
  1920. X!     if (RawState ()) {
  1921. X          MoveCursor (LINES, 0);
  1922. X          sleep (2);
  1923. X      } else {
  1924. X***************
  1925. X*** 66,73 ****
  1926. X  
  1927. X  void clear_message ()
  1928. X  {
  1929. X!     MoveCursor(LINES, 0);
  1930. X!     CleartoEOLN();
  1931. X  }
  1932. X  
  1933. X  
  1934. X--- 68,77 ----
  1935. X  
  1936. X  void clear_message ()
  1937. X  {
  1938. X!     if (RawState ()) {
  1939. X!         MoveCursor (LINES, 0);
  1940. X!         CleartoEOLN ();
  1941. X!     }
  1942. X  }
  1943. X  
  1944. X  
  1945. X***************
  1946. X*** 78,91 ****
  1947. X  {
  1948. X      int pos;
  1949. X  
  1950. X!     pos = (COLS - (int) strlen (str)) / 2;
  1951. X!     MoveCursor (line, pos);
  1952. X!     if (inverse) {
  1953. X!         StartInverse ();
  1954. X      }
  1955. X      printf ("%s", str);
  1956. X      fflush (stdout);
  1957. X!     if (inverse) {
  1958. X          EndInverse ();
  1959. X      }
  1960. X  }
  1961. X--- 82,97 ----
  1962. X  {
  1963. X      int pos;
  1964. X  
  1965. X!     if (RawState ()) {
  1966. X!         pos = (COLS - (int) strlen (str)) / 2;
  1967. X!         MoveCursor (line, pos);
  1968. SHAR_EOF
  1969. echo "End of tin part 3"
  1970. echo "File tin.patch06 is continued in part 4"
  1971. echo "4" > shar3_seq_.tmp
  1972. exit 0
  1973.  
  1974. -- 
  1975.  Dr. med. dipl.-math Dieter Becker           Tel.: (0 / +49) 6841 - 16 3046
  1976.  Medizinische Universitaets- und Poliklinik  Fax.: (0 / +49) 6841 - 16 3369
  1977.  Innere Medizin III                         
  1978.  D - 6650 Homburg / Saar                     Email: becker@med-in.uni-sb.de
  1979. exit 0 # Just in case...
  1980. -- 
  1981. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1982. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1983. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1984. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1985.