home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume29 / regexpr / patch01 < prev    next >
Encoding:
Text File  |  1992-04-05  |  6.0 KB  |  176 lines

  1. Newsgroups: comp.sources.misc
  2. From: ylo@ngs.fi (Tatu Ylonen)
  3. Subject:  v29i059:  regexpr - regexp library compatible with gnu regex, Patch01
  4. Message-ID: <1992Apr5.033615.503@sparky.imd.sterling.com>
  5. X-Md4-Signature: 4b2f1174fa2132b191b350dbd7121527
  6. Date: Sun, 5 Apr 1992 03:36:15 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: ylo@ngs.fi (Tatu Ylonen)
  10. Posting-number: Volume 29, Issue 59
  11. Archive-name: regexpr/patch01
  12. Environment: UNIX, MSDOS
  13. Patch-To: regexpr: Volume 27, Issue 23
  14.  
  15. This patch contains the following changes to the regexpr module.
  16.  
  17.   - Matching agains registers (the \1 construct) did not work properly
  18.     (the fastmap was computed incorrectly).
  19.   - Assert bounds in re_search_2 were too loose, and have been changed
  20.     to reflect the actual behaviour.
  21.   - The copyright notice has been clarified, but no significant
  22.     changes have been made.
  23.  
  24. The only real bug reported so far has been the problem with matching
  25. against registers, and it is now fixed.
  26.  
  27. The patch is a context diff inside a shar.
  28.  
  29.     Tatu Ylonen <ylo@cs.hut.fi>
  30.  
  31. #! /bin/sh
  32. # This is a shell archive.  Remove anything before this line, then unpack
  33. # it by saving it into a file and typing "sh file".  To overwrite existing
  34. # files, type "sh file -c".  You can also feed this as standard input via
  35. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  36. # will see the following message at the end:
  37. #        "End of shell archive."
  38. # Contents:  regexpr-patch1
  39. # Wrapped by ylo@ngs.fi on Sun Mar 29 17:14:52 1992
  40. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  41. if test -f regexpr-patch1 -a "${1}" != "-c" ; then 
  42.   echo shar: Will not over-write existing file \"regexpr-patch1\"
  43. else
  44. echo shar: Extracting \"regexpr-patch1\" \(3970 characters\)
  45. sed "s/^X//" >regexpr-patch1 <<'END_OF_regexpr-patch1'
  46. Xdiff -c old-regexpr/regexpr.c new-regexpr/regexpr.c
  47. X*** old-regexpr/regexpr.c    Sun Mar 29 16:41:46 1992
  48. X--- new-regexpr/regexpr.c    Sun Mar 29 16:55:41 1992
  49. X***************
  50. X*** 7,18 ****
  51. X  Copyright (c) 1991 Tatu Ylonen, Espoo, Finland
  52. X  
  53. X  Permission to use, copy, modify, distribute, and sell this software
  54. X! and its documentation for any purpose is hereby granted without fee,
  55. X! provided that the above copyright notice appear in all copies.  This
  56. X! software is provided "as is" without express or implied warranty.
  57. X  
  58. X  Created: Thu Sep 26 17:14:05 1991 ylo
  59. X! Last modified: Mon Nov  4 17:06:48 1991 ylo
  60. X  
  61. X  This code draws many ideas from the regular expression packages by
  62. X  Henry Spencer of the University of Toronto and Richard Stallman of the
  63. X--- 7,22 ----
  64. X  Copyright (c) 1991 Tatu Ylonen, Espoo, Finland
  65. X  
  66. X  Permission to use, copy, modify, distribute, and sell this software
  67. X! and its documentation is hereby granted without fee, provided that the
  68. X! above copyright notice appears in all source code copies, the name of
  69. X! Tatu Ylonen is not used to advertise products containing this software
  70. X! or a derivation thereof, and all modified versions are clearly marked
  71. X! as such.
  72. X  
  73. X+ This software is provided "as is" without express or implied warranty.
  74. X+ 
  75. X  Created: Thu Sep 26 17:14:05 1991 ylo
  76. X! Last modified: Sun Mar 29 16:47:31 1992 ylo
  77. X  
  78. X  This code draws many ideas from the regular expression packages by
  79. X  Henry Spencer of the University of Toronto and Richard Stallman of the
  80. X***************
  81. X*** 21,27 ****
  82. X  Emacs-specific code and syntax table code is almost directly borrowed
  83. X  from GNU regexp.
  84. X  
  85. X! $Header: /u/src/lib/tools/RCS/regexpr.c,v 1.1 91/12/30 08:53:37 ylo Exp $
  86. X  
  87. X  */
  88. X  
  89. X--- 25,31 ----
  90. X  Emacs-specific code and syntax table code is almost directly borrowed
  91. X  from GNU regexp.
  92. X  
  93. X! $Header: /u/src/lib/tools/RCS/regexpr.c,v 1.4 92/03/29 16:52:04 ylo Exp $
  94. X  
  95. X  */
  96. X  
  97. X***************
  98. X*** 816,822 ****
  99. X      pos++;
  100. X      break;
  101. X        case Cmatch_memory:
  102. X!     /* should this ever happen for sensible patterns??? */
  103. X      *can_be_null = 1;
  104. X      return;
  105. X        case Cjump:
  106. X--- 820,827 ----
  107. X      pos++;
  108. X      break;
  109. X        case Cmatch_memory:
  110. X!     for (a = 0; a < 256; a++)
  111. X!       fastmap[a] = 1;
  112. X      *can_be_null = 1;
  113. X      return;
  114. X        case Cjump:
  115. X***************
  116. X*** 1377,1383 ****
  117. X    char anchor;
  118. X    
  119. X    assert(size1 >= 0 && size2 >= 0 && pos >= 0 && mstop >= 0);
  120. X!   assert(pos + range + 1 >= 0 && pos + range - 1 <= size1 + size2);
  121. X    assert(pos <= mstop);
  122. X    
  123. X    fastmap = bufp->fastmap;
  124. X--- 1382,1388 ----
  125. X    char anchor;
  126. X    
  127. X    assert(size1 >= 0 && size2 >= 0 && pos >= 0 && mstop >= 0);
  128. X!   assert(pos + range >= 0 && pos + range <= size1 + size2);
  129. X    assert(pos <= mstop);
  130. X    
  131. X    fastmap = bufp->fastmap;
  132. Xdiff -c old-regexpr/regexpr.h new-regexpr/regexpr.h
  133. X*** old-regexpr/regexpr.h    Sun Mar 29 16:41:44 1992
  134. X--- new-regexpr/regexpr.h    Sun Mar 29 16:55:41 1992
  135. X***************
  136. X*** 7,18 ****
  137. X  Copyright (c) 1991 Tatu Ylonen, Espoo, Finland
  138. X  
  139. X  Permission to use, copy, modify, distribute, and sell this software
  140. X! and its documentation for any purpose is hereby granted without fee,
  141. X! provided that the above copyright notice appear in all copies.  This
  142. X! software is provided "as is" without express or implied warranty.
  143. X  
  144. X  Created: Thu Sep 26 17:15:36 1991 ylo
  145. X! Last modified: Mon Nov  4 15:49:46 1991 ylo
  146. X  
  147. X  */
  148. X  
  149. X--- 7,22 ----
  150. X  Copyright (c) 1991 Tatu Ylonen, Espoo, Finland
  151. X  
  152. X  Permission to use, copy, modify, distribute, and sell this software
  153. X! and its documentation is hereby granted without fee, provided that the
  154. X! above copyright notice appears in all source code copies, the name of
  155. X! Tatu Ylonen is not used to advertise products containing this software
  156. X! or a derivation thereof, and all modified versions are clearly marked
  157. X! as such.
  158. X  
  159. X+ This software is provided "as is" without express or implied warranty.
  160. X+ 
  161. X  Created: Thu Sep 26 17:15:36 1991 ylo
  162. X! Last modified: Fri Jan  3 12:05:45 1992 ylo
  163. X  
  164. X  */
  165. X  
  166. END_OF_regexpr-patch1
  167. if test 3970 -ne `wc -c <regexpr-patch1`; then
  168.     echo shar: \"regexpr-patch1\" unpacked with wrong size!
  169. fi
  170. # end of overwriting check
  171. fi
  172. echo shar: End of shell archive.
  173. exit 0
  174.  
  175. exit 0 # Just in case...
  176.