home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume35 / ee / patch01 < prev    next >
Encoding:
Text File  |  1993-03-03  |  8.8 KB  |  301 lines

  1. Newsgroups: comp.sources.misc
  2. From: hugh@nsmdserv.cnd.hp.com (Hugh F. Mahon)
  3. Subject: v35i123:  ee - Easy Editor, a simple editor for UNIX, Patch01
  4. Message-ID: <1993Mar4.204613.13052@sparky.imd.sterling.com>
  5. Date: Thu, 4 Mar 1993 20:46:13 GMT
  6. Approved: kent@sparky.imd.sterling.com
  7. X-Md4-Signature: 298c5ab95e39a9af84ff88a0f9330c45
  8.  
  9. Submitted-by: hugh@nsmdserv.cnd.hp.com (Hugh F. Mahon)
  10. Posting-number: Volume 35, Issue 123
  11. Archive-name: ee/patch01
  12. Environment: SYSV, SunOS, Curses
  13. Patch-To: ee: Volume 35, Issue 80-84
  14.  
  15. Some defects were reported by people who built EasyEdit ("ee").  It also 
  16. became clear that other things could be done to make ee easier to build.
  17.  
  18. Known defects:
  19.  
  20.     1. ee core dumped on exit or write of file when no file name given 
  21.        when starting ee
  22.     2. ee core dumped when 'ispell' was chosen in spell menu
  23.     3. ee could core dump during format of a paragraph
  24.     4. ee could read a file twice after an error occurred when 
  25.        multiple files given on command line
  26.  
  27. The curses alternative, new_curse.c was modified to remove dependence on 
  28. -DSUN for some platforms.
  29.  
  30. The Makefile was modified to provide information in an easier to 
  31. understand way.
  32.  
  33. The following patch fixes the known deficiencies.
  34.  
  35. To use the patch, unpack it from the shar file, then use the 'patch' 
  36. utility, avaliable from many ftp archive sites (such as wuarchive.wustl.edu) 
  37. if you don't already have it.  It is a valuable tool to have.
  38.  
  39. Hugh Mahon              |__|     
  40. h_mahon@fc.hp.com       |  |     
  41.                            |\  /|
  42.                            | \/ |
  43. -----------
  44. diff -cr ../ee.old/Makefile ./Makefile
  45. *** ../ee.old/Makefile    Thu Mar  4 14:38:33 1993
  46. --- ./Makefile    Thu Mar  4 14:36:56 1993
  47. ***************
  48. *** 11,33 ****
  49.   # The "clean" target ("make clean") will remove the ee and new_curse.o 
  50.   # object files, and the ee binary.
  51.   #
  52. - # If compiling on Sun, include -DSUN in the DEFINES line, and -I/usr/5include 
  53. - # and -L/usr/5lib in the CFLAGS (this may be useful for other systems as well).
  54. - #
  55.   # If the system does not have localization routines, use the -DNO_CATGETS
  56.   # define.  If the system supports setlocale(), catopen(), and catgets() and 
  57.   # localization is desired, do not use -DNO_CATGETS.
  58.   #
  59.   
  60.   # for System V, using new_curse with terminfo
  61. ! DEFINES =    -DSYS5 -DNCURSE -DNO_CATGETS
  62. ! #DEFINES =    -DSYS5 
  63.   
  64. ! # for BSD, using new_curse with tremcap
  65.   #DEFINES =     -DCAP -DNCURSE
  66.   
  67.   # flags for compilation
  68. ! CFLAGS = -s
  69.   
  70.   all :    ee
  71.   
  72. --- 11,34 ----
  73.   # The "clean" target ("make clean") will remove the ee and new_curse.o 
  74.   # object files, and the ee binary.
  75.   #
  76.   # If the system does not have localization routines, use the -DNO_CATGETS
  77.   # define.  If the system supports setlocale(), catopen(), and catgets() and 
  78.   # localization is desired, do not use -DNO_CATGETS.
  79.   #
  80. + #
  81.   
  82.   # for System V, using new_curse with terminfo
  83. ! DEFINES =    -DSYS5 -DNCURSE 
  84.   
  85. ! # for BSD, using new_curse with termcap
  86.   #DEFINES =     -DCAP -DNCURSE
  87.   
  88.   # flags for compilation
  89. ! CFLAGS = -s -DNO_CATGETS
  90. ! # For Sun systems, remove the '#' from the front of the next two lines:
  91. ! #DEFINES = -DSYS5 -DNCURSE 
  92. ! #CFLAGS  = -I/usr/5include -L/usr/5lib -DNO_CATGETS -s
  93.   
  94.   all :    ee
  95.   
  96. diff -cr ../ee.old/README.ee ./README.ee
  97. *** ../ee.old/README.ee    Thu Mar  4 14:38:18 1993
  98. --- ./README.ee    Thu Mar  4 14:36:56 1993
  99. ***************
  100. *** 84,90 ****
  101.   
  102.   Both ee and new_curse were developed using K&R C (also known as "classic 
  103.   C").  Some tweaks may be required to make ee and new_curse compile on 
  104. ! some platforms.
  105.   
  106.   ee is the result of several conflicting design goals.  While I know that it 
  107.   solves the problems of some users, I also have no doubt that some will decry 
  108. --- 84,91 ----
  109.   
  110.   Both ee and new_curse were developed using K&R C (also known as "classic 
  111.   C").  Some tweaks may be required to make ee and new_curse compile on 
  112. ! some platforms.  Please read the Makefile for information on building ee for 
  113. ! your platform.
  114.   
  115.   ee is the result of several conflicting design goals.  While I know that it 
  116.   solves the problems of some users, I also have no doubt that some will decry 
  117. diff -cr ../ee.old/ee.c ./ee.c
  118. *** ../ee.old/ee.c    Thu Mar  4 14:38:26 1993
  119. --- ./ee.c    Thu Mar  4 14:36:58 1993
  120. ***************
  121. *** 51,57 ****
  122.    |    proprietary information which is protected by
  123.    |    copyright.  All rights are reserved.
  124.    |
  125. !  |    $Header: /users/hugh/tmp/old_ae/ee.c,v 1.65 1993/02/19 05:00:07 hugh Exp $
  126.    |
  127.    */
  128.   
  129. --- 51,57 ----
  130.    |    proprietary information which is protected by
  131.    |    copyright.  All rights are reserved.
  132.    |
  133. !  |    $Header: /users/hugh/tmp/old_ae/ee.c,v 1.66 1993/02/28 01:00:54 hugh Exp $
  134.    |
  135.    */
  136.   
  137. ***************
  138. *** 64,70 ****
  139.       "copyright.  All rights are reserved."
  140.       };
  141.   
  142. ! char *version = "@(#) ee, version 1.2.2 $Revision: 1.65 $";
  143.   
  144.   #ifdef NCURSE
  145.   #include "new_curse.h"
  146. --- 64,70 ----
  147.       "copyright.  All rights are reserved."
  148.       };
  149.   
  150. ! char *version = "@(#) ee, version 1.2.2 pl 1 $Revision: 1.66 $";
  151.   
  152.   #ifdef NCURSE
  153.   #include "new_curse.h"
  154. ***************
  155. *** 1811,1817 ****
  156. --- 1811,1820 ----
  157.           wprintw(com_win, file_is_dir_msg, tmp_file);
  158.           wrefresh(com_win);
  159.           if (input_file)
  160. +         {
  161.               quit(0);
  162. +             return;
  163. +         }
  164.           else
  165.               return;
  166.       }
  167. ***************
  168. *** 2102,2108 ****
  169.           free(curr_line->next_line);
  170.       }
  171.       curr_line->next_line = NULL;
  172. !     curr_line->line = NULL;
  173.       curr_line->line_length = 1;
  174.       curr_line->line_number = 1;
  175.       point = curr_line->line;
  176. --- 2105,2111 ----
  177.           free(curr_line->next_line);
  178.       }
  179.       curr_line->next_line = NULL;
  180. !     *curr_line->line = NULL;
  181.       curr_line->line_length = 1;
  182.       curr_line->line_number = 1;
  183.       point = curr_line->line;
  184. ***************
  185. *** 2121,2127 ****
  186.       int write_flag = TRUE;
  187.   
  188.       charac = lines = 0;
  189. !     if (strcmp(in_file_name, file_name))
  190.       {
  191.           if (temp_fp = fopen(file_name, "r"))
  192.           {
  193. --- 2124,2130 ----
  194.       int write_flag = TRUE;
  195.   
  196.       charac = lines = 0;
  197. !     if ((in_file_name == NULL) || strcmp(in_file_name, file_name))
  198.       {
  199.           if (temp_fp = fopen(file_name, "r"))
  200.           {
  201. ***************
  202. *** 3791,3797 ****
  203.            |    in the line without crossing the margin
  204.            */
  205.   
  206. !         while (((word_len = first_word_len(curr_line->next_line)) > 0) 
  207.               && ((scr_pos + word_len) < right_margin))
  208.           {
  209.               adv_line();
  210. --- 3794,3801 ----
  211.            |    in the line without crossing the margin
  212.            */
  213.   
  214. !         while ((curr_line->next_line != NULL) && 
  215. !                ((word_len = first_word_len(curr_line->next_line)) > 0) 
  216.               && ((scr_pos + word_len) < right_margin))
  217.           {
  218.               adv_line();
  219. diff -cr ../ee.old/new_curse.c ./new_curse.c
  220. *** ../ee.old/new_curse.c    Thu Mar  4 14:38:31 1993
  221. --- ./new_curse.c    Thu Mar  4 14:37:00 1993
  222. ***************
  223. *** 39,45 ****
  224.    |    Copyright (c) 1986, 1987, 1988, 1991, 1992 Hugh Mahon
  225.    |    All are rights reserved.
  226.    |
  227. !  |    $Header: /users/hugh/tmp/old_ae/new_curse.c,v 1.20 1992/12/18 05:04:39 hugh Exp $
  228.    |
  229.    */
  230.   
  231. --- 39,45 ----
  232.    |    Copyright (c) 1986, 1987, 1988, 1991, 1992 Hugh Mahon
  233.    |    All are rights reserved.
  234.    |
  235. !  |    $Header: /users/hugh/tmp/old_ae/new_curse.c,v 1.21 1993/02/28 21:50:21 hugh Exp $
  236.    |
  237.    */
  238.   
  239. ***************
  240. *** 49,55 ****
  241.   char *copyright_message[] = { "Copyright (c) 1986, 1987, 1988, 1991, 1992 Hugh Mahon",
  242.                   "All rights are reserved."};
  243.   
  244. ! char * new_curse_name= "@(#) new_curse.c $Revision: 1.20 $";
  245.   
  246.   WINDOW *curscr;
  247.   static WINDOW *virtual_scr;
  248. --- 49,55 ----
  249.   char *copyright_message[] = { "Copyright (c) 1986, 1987, 1988, 1991, 1992 Hugh Mahon",
  250.                   "All rights are reserved."};
  251.   
  252. ! char * new_curse_name= "@(#) new_curse.c $Revision: 1.21 $";
  253.   
  254.   WINDOW *curscr;
  255.   static WINDOW *virtual_scr;
  256. ***************
  257. *** 1967,1973 ****
  258.       {
  259.           while (Count > 1)
  260.           {
  261. !             if ((string[--Count] != -1) && (string[Count] != 255))
  262.               {
  263.   #ifdef DIAG
  264.   fprintf(stderr, "ungetting character %d\n", string[Count]);fflush(stdout);
  265. --- 1967,1974 ----
  266.       {
  267.           while (Count > 1)
  268.           {
  269. !             if ((string[--Count] != -1) && 
  270. !                     ((unsigned) string[Count] != 255))
  271.               {
  272.   #ifdef DIAG
  273.   fprintf(stderr, "ungetting character %d\n", string[Count]);fflush(stdout);
  274. ***************
  275. *** 2234,2242 ****
  276.       Intr = Terminal.c_cc[VINTR];    /* get the interrupt character    */
  277.       Terminal.c_lflag &= ~ICANON;    /* disable canonical operation    */
  278.       Terminal.c_lflag &= ~ISIG;    /* disable signal checking    */
  279. ! #ifdef SUN
  280.       Terminal.c_lflag &= ~FLUSHO;
  281.       Terminal.c_lflag &= ~PENDIN;
  282.       Terminal.c_lflag &= ~IEXTEN;
  283.   #endif
  284.       Terminal.c_cc[VMIN] = 1;        /* minimum of one character */
  285. --- 2235,2247 ----
  286.       Intr = Terminal.c_cc[VINTR];    /* get the interrupt character    */
  287.       Terminal.c_lflag &= ~ICANON;    /* disable canonical operation    */
  288.       Terminal.c_lflag &= ~ISIG;    /* disable signal checking    */
  289. ! #ifdef FLUSHO
  290.       Terminal.c_lflag &= ~FLUSHO;
  291. + #endif
  292. + #ifdef PENDIN
  293.       Terminal.c_lflag &= ~PENDIN;
  294. + #endif
  295. + #ifdef IEXTEN
  296.       Terminal.c_lflag &= ~IEXTEN;
  297.   #endif
  298.       Terminal.c_cc[VMIN] = 1;        /* minimum of one character */
  299. exit 0 # Just in case...
  300.