home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sources.misc
- From: ylo@ngs.fi (Tatu Ylonen)
- Subject: v29i059: regexpr - regexp library compatible with gnu regex, Patch01
- Message-ID: <1992Apr5.033615.503@sparky.imd.sterling.com>
- X-Md4-Signature: 4b2f1174fa2132b191b350dbd7121527
- Date: Sun, 5 Apr 1992 03:36:15 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: ylo@ngs.fi (Tatu Ylonen)
- Posting-number: Volume 29, Issue 59
- Archive-name: regexpr/patch01
- Environment: UNIX, MSDOS
- Patch-To: regexpr: Volume 27, Issue 23
-
- This patch contains the following changes to the regexpr module.
-
- - Matching agains registers (the \1 construct) did not work properly
- (the fastmap was computed incorrectly).
- - Assert bounds in re_search_2 were too loose, and have been changed
- to reflect the actual behaviour.
- - The copyright notice has been clarified, but no significant
- changes have been made.
-
- The only real bug reported so far has been the problem with matching
- against registers, and it is now fixed.
-
- The patch is a context diff inside a shar.
-
- Tatu Ylonen <ylo@cs.hut.fi>
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of shell archive."
- # Contents: regexpr-patch1
- # Wrapped by ylo@ngs.fi on Sun Mar 29 17:14:52 1992
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f regexpr-patch1 -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"regexpr-patch1\"
- else
- echo shar: Extracting \"regexpr-patch1\" \(3970 characters\)
- sed "s/^X//" >regexpr-patch1 <<'END_OF_regexpr-patch1'
- Xdiff -c old-regexpr/regexpr.c new-regexpr/regexpr.c
- X*** old-regexpr/regexpr.c Sun Mar 29 16:41:46 1992
- X--- new-regexpr/regexpr.c Sun Mar 29 16:55:41 1992
- X***************
- X*** 7,18 ****
- X Copyright (c) 1991 Tatu Ylonen, Espoo, Finland
- X
- X Permission to use, copy, modify, distribute, and sell this software
- X! and its documentation for any purpose is hereby granted without fee,
- X! provided that the above copyright notice appear in all copies. This
- X! software is provided "as is" without express or implied warranty.
- X
- X Created: Thu Sep 26 17:14:05 1991 ylo
- X! Last modified: Mon Nov 4 17:06:48 1991 ylo
- X
- X This code draws many ideas from the regular expression packages by
- X Henry Spencer of the University of Toronto and Richard Stallman of the
- X--- 7,22 ----
- X Copyright (c) 1991 Tatu Ylonen, Espoo, Finland
- X
- X Permission to use, copy, modify, distribute, and sell this software
- X! and its documentation is hereby granted without fee, provided that the
- X! above copyright notice appears in all source code copies, the name of
- X! Tatu Ylonen is not used to advertise products containing this software
- X! or a derivation thereof, and all modified versions are clearly marked
- X! as such.
- X
- X+ This software is provided "as is" without express or implied warranty.
- X+
- X Created: Thu Sep 26 17:14:05 1991 ylo
- X! Last modified: Sun Mar 29 16:47:31 1992 ylo
- X
- X This code draws many ideas from the regular expression packages by
- X Henry Spencer of the University of Toronto and Richard Stallman of the
- X***************
- X*** 21,27 ****
- X Emacs-specific code and syntax table code is almost directly borrowed
- X from GNU regexp.
- X
- X! $Header: /u/src/lib/tools/RCS/regexpr.c,v 1.1 91/12/30 08:53:37 ylo Exp $
- X
- X */
- X
- X--- 25,31 ----
- X Emacs-specific code and syntax table code is almost directly borrowed
- X from GNU regexp.
- X
- X! $Header: /u/src/lib/tools/RCS/regexpr.c,v 1.4 92/03/29 16:52:04 ylo Exp $
- X
- X */
- X
- X***************
- X*** 816,822 ****
- X pos++;
- X break;
- X case Cmatch_memory:
- X! /* should this ever happen for sensible patterns??? */
- X *can_be_null = 1;
- X return;
- X case Cjump:
- X--- 820,827 ----
- X pos++;
- X break;
- X case Cmatch_memory:
- X! for (a = 0; a < 256; a++)
- X! fastmap[a] = 1;
- X *can_be_null = 1;
- X return;
- X case Cjump:
- X***************
- X*** 1377,1383 ****
- X char anchor;
- X
- X assert(size1 >= 0 && size2 >= 0 && pos >= 0 && mstop >= 0);
- X! assert(pos + range + 1 >= 0 && pos + range - 1 <= size1 + size2);
- X assert(pos <= mstop);
- X
- X fastmap = bufp->fastmap;
- X--- 1382,1388 ----
- X char anchor;
- X
- X assert(size1 >= 0 && size2 >= 0 && pos >= 0 && mstop >= 0);
- X! assert(pos + range >= 0 && pos + range <= size1 + size2);
- X assert(pos <= mstop);
- X
- X fastmap = bufp->fastmap;
- Xdiff -c old-regexpr/regexpr.h new-regexpr/regexpr.h
- X*** old-regexpr/regexpr.h Sun Mar 29 16:41:44 1992
- X--- new-regexpr/regexpr.h Sun Mar 29 16:55:41 1992
- X***************
- X*** 7,18 ****
- X Copyright (c) 1991 Tatu Ylonen, Espoo, Finland
- X
- X Permission to use, copy, modify, distribute, and sell this software
- X! and its documentation for any purpose is hereby granted without fee,
- X! provided that the above copyright notice appear in all copies. This
- X! software is provided "as is" without express or implied warranty.
- X
- X Created: Thu Sep 26 17:15:36 1991 ylo
- X! Last modified: Mon Nov 4 15:49:46 1991 ylo
- X
- X */
- X
- X--- 7,22 ----
- X Copyright (c) 1991 Tatu Ylonen, Espoo, Finland
- X
- X Permission to use, copy, modify, distribute, and sell this software
- X! and its documentation is hereby granted without fee, provided that the
- X! above copyright notice appears in all source code copies, the name of
- X! Tatu Ylonen is not used to advertise products containing this software
- X! or a derivation thereof, and all modified versions are clearly marked
- X! as such.
- X
- X+ This software is provided "as is" without express or implied warranty.
- X+
- X Created: Thu Sep 26 17:15:36 1991 ylo
- X! Last modified: Fri Jan 3 12:05:45 1992 ylo
- X
- X */
- X
- END_OF_regexpr-patch1
- if test 3970 -ne `wc -c <regexpr-patch1`; then
- echo shar: \"regexpr-patch1\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- echo shar: End of shell archive.
- exit 0
-
- exit 0 # Just in case...
-