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