Deleted Added
full compact
regex.c (25839) regex.c (34461)
1/* Extended regular expression matching and search library,
2 version 0.12.
3 (Implements POSIX draft P10003.2/D11.2, except for
1/* Extended regular expression matching and search library, version
2 0.12. (Implements POSIX draft P10003.2/D11.2, except for
4 internationalization features.)
5
6 Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.

--- 22 unchanged lines hidden (view full) ---

34#endif
35
36/* The `emacs' switch turns on certain matching commands
37 that make sense only in Emacs. */
38#ifdef emacs
39
40#include "lisp.h"
41#include "buffer.h"
3 internationalization features.)
4
5 Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.

--- 22 unchanged lines hidden (view full) ---

33#endif
34
35/* The `emacs' switch turns on certain matching commands
36 that make sense only in Emacs. */
37#ifdef emacs
38
39#include "lisp.h"
40#include "buffer.h"
41
42/* Make syntax table lookup grant data in gl_state. */
43#define SYNTAX_ENTRY_VIA_PROPERTY
44
42#include "syntax.h"
45#include "syntax.h"
46#include "charset.h"
47#include "category.h"
43
48
44/* Emacs uses `NULL' as a predicate. */
45#undef NULL
49#define malloc xmalloc
50#define free xfree
46
47#else /* not emacs */
48
49/* We used to test for `BSTRING' here, but only GCC and Emacs define
50 `BSTRING', as far as I know, and neither of them use this code. */
51#if HAVE_STRING_H || STDC_HEADERS
52#include <string.h>
53#ifndef bcmp

--- 101 unchanged lines hidden (view full) ---

155
156#ifndef NULL
157#define NULL 0
158#endif
159
160/* We remove any previous definition of `SIGN_EXTEND_CHAR',
161 since ours (we hope) works properly with all combinations of
162 machines, compilers, `char' and `unsigned char' argument types.
51
52#else /* not emacs */
53
54/* We used to test for `BSTRING' here, but only GCC and Emacs define
55 `BSTRING', as far as I know, and neither of them use this code. */
56#if HAVE_STRING_H || STDC_HEADERS
57#include <string.h>
58#ifndef bcmp

--- 101 unchanged lines hidden (view full) ---

160
161#ifndef NULL
162#define NULL 0
163#endif
164
165/* We remove any previous definition of `SIGN_EXTEND_CHAR',
166 since ours (we hope) works properly with all combinations of
167 machines, compilers, `char' and `unsigned char' argument types.
163 (Per Bothner suggested the basic approach.) */
168 (Per Bothner suggested the basic approach.) */
164#undef SIGN_EXTEND_CHAR
165#if __STDC__
166#define SIGN_EXTEND_CHAR(c) ((signed char) (c))
167#else /* not __STDC__ */
168/* As in Harbison and Steele. */
169#define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128)
170#endif
171

--- 3630 unchanged lines hidden (view full) ---

3802
3803 if (EVER_MATCHED_SOMETHING (reg_info[*p]))
3804 {
3805 unsigned r;
3806
3807 EVER_MATCHED_SOMETHING (reg_info[*p]) = 0;
3808
3809 /* Restore this and inner groups' (if any) registers. */
169#undef SIGN_EXTEND_CHAR
170#if __STDC__
171#define SIGN_EXTEND_CHAR(c) ((signed char) (c))
172#else /* not __STDC__ */
173/* As in Harbison and Steele. */
174#define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128)
175#endif
176

--- 3630 unchanged lines hidden (view full) ---

3807
3808 if (EVER_MATCHED_SOMETHING (reg_info[*p]))
3809 {
3810 unsigned r;
3811
3812 EVER_MATCHED_SOMETHING (reg_info[*p]) = 0;
3813
3814 /* Restore this and inner groups' (if any) registers. */
3810 for (r = *p; r < *p + *(p + 1); r++)
3811 {
3812 regstart[r] = old_regstart[r];
3815 for (r = *p; r < *p + *(p + 1); r++)
3816 {
3817 regstart[r] = old_regstart[r];
3813
3818
3814 /* xx why this test? */
3815 if ((int) old_regend[r] >= (int) regstart[r])
3816 regend[r] = old_regend[r];
3817 }
3818 }
3819 /* xx why this test? */
3820 if (old_regend[r] >= regstart[r])
3821 regend[r] = old_regend[r];
3822 }
3823 }
3819 p1++;
3820 EXTRACT_NUMBER_AND_INCR (mcnt, p1);
3821 PUSH_FAILURE_POINT (p1 + mcnt, d, -2);
3822
3823 goto fail;
3824 }
3825 }
3826

--- 1162 unchanged lines hidden ---
3824 p1++;
3825 EXTRACT_NUMBER_AND_INCR (mcnt, p1);
3826 PUSH_FAILURE_POINT (p1 + mcnt, d, -2);
3827
3828 goto fail;
3829 }
3830 }
3831

--- 1162 unchanged lines hidden ---