home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 2 / 2632 < prev    next >
Internet Message Format  |  1991-01-30  |  2KB

  1. From: bang!iverson@uunet.uu.net (Tim Iverson)
  2. Newsgroups: comp.sources.bugs,gnu.utils.bug,alt.sources
  3. Subject: Bug report and unofficial patch for patch v12u2
  4. Message-ID: <1991Jan22.081802.7268@bang.uucp>
  5. Date: 22 Jan 91 08:18:02 GMT
  6. Approved: info-gnu@prep.ai.mit.edu
  7.  
  8. --text follows this line--
  9. This is an unofficial patch to patch 12u2 (the unified-diff-eating patch) to
  10. overcome a problem when creating new files.
  11.  
  12. The Problem:    For the sake of brevity, let q(x) = 2^x*INITHUNKMAX-1.
  13.         When patch tries to create a file with q(n) lines
  14.         immediately after creating a q(m) line file and n < m,
  15.         patch will halt with a segmentation violation.
  16.  
  17.         Actually, if you happen to test this on Tuesday with a
  18.         sickle moon in the noontime sky, you may experience other
  19.         bizzare problems due to memory corruption (but only if a
  20.         dog barks while you run the test).
  21.  
  22. To Recreate:    Simply feed patch a file that contains two patches, one
  23.         for a 499 line file diff'd against /dev/null, followed by
  24.         one for a 124 line file diff'd against /dev/null.
  25.  
  26. To Fix:        Apply the enclosed patch.
  27.  
  28. - Tim Iverson
  29.   iverson@xstor.com -/- uunet!xstor!iverson
  30.  
  31. BTW, this file also includes a patch to common.h to overcome a type clash
  32. with a standard include file under SCO Unix.  It won't hurt you to leave it
  33. there, but if SCO offends your delicate sensibilities, hacking it off may
  34. yield a momentary pleasure.
  35.  
  36. #
  37. ################ patch starts here
  38. ##
  39. Prereq: "12u2"
  40. --- ../patch-2.0.12u2/patchlevel.h    Mon Jan  7 03:22:06 1991
  41. +++ ./patchlevel.h    Mon Jan 21 18:12:33 1991
  42. @@ -1,1 +1,1 @@
  43. -#define PATCHLEVEL "12u2"
  44. +#define PATCHLEVEL "12u3"
  45. --- ../patch-2.0.12u2/pch.c    Mon Jan  7 03:19:12 1991
  46. +++ ./pch.c    Mon Jan 21 18:09:50 1991
  47. @@ -779,7 +779,7 @@
  48.          malformed ();
  49.      if (!p_first && !p_ptrn_lines)
  50.          p_first = 1;
  51. -    p_max = p_ptrn_lines + p_repl_lines;
  52. +    p_max = p_ptrn_lines + p_repl_lines + 1;
  53.      while (p_max >= hunkmax)
  54.          grow_hunkmax();
  55.      p_max = hunkmax;
  56. --- ../common.h    Mon Jan 21 23:06:40 1991
  57. +++ ./common.h    Mon Jan 21 23:06:15 1991
  58. @@ -153,9 +153,11 @@
  59.  long atol();
  60.  long lseek();
  61.  char *mktemp();
  62. +#ifndef M_UNIX
  63.  #ifdef CHARSPRINTF
  64.  char *sprintf();
  65.  #else
  66.  int sprintf();
  67. +#endif
  68.  #endif
  69.  char *getenv();
  70. ##
  71. ################ patch ends here
  72. #
  73.