diff options
| author | Richard M. Stallman | 1995-11-11 20:51:37 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-11-11 20:51:37 +0000 |
| commit | 68d96f02f39e6fe8363cd98364bb221803f0a484 (patch) | |
| tree | f047a860dbb74c6cac4174c63b226adca78612b7 /src | |
| parent | 0c7fb3abbe0e7e937c18439eaea4a98e2b481bad (diff) | |
| download | emacs-68d96f02f39e6fe8363cd98364bb221803f0a484.tar.gz emacs-68d96f02f39e6fe8363cd98364bb221803f0a484.zip | |
(NUM_FAILURE_ITEMS, POP_FAILURE_POINT, PUSH_FAILURE_POINT):
Do not test for backtracking--do the same thing with or without.
(_GNU_SOURCE): Undef before defining.
(re_max_failures): Initialize to just 20000.
Diffstat (limited to 'src')
| -rw-r--r-- | src/regex.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/regex.c b/src/regex.c index e83e28dac1e..480cbbc1632 100644 --- a/src/regex.c +++ b/src/regex.c | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #pragma alloca | 24 | #pragma alloca |
| 25 | #endif | 25 | #endif |
| 26 | 26 | ||
| 27 | #undef _GNU_SOURCE | ||
| 27 | #define _GNU_SOURCE | 28 | #define _GNU_SOURCE |
| 28 | 29 | ||
| 29 | #ifdef HAVE_CONFIG_H | 30 | #ifdef HAVE_CONFIG_H |
| @@ -999,7 +1000,7 @@ static const char *re_error_msgid[] = | |||
| 999 | This is a variable only so users of regex can assign to it; we never | 1000 | This is a variable only so users of regex can assign to it; we never |
| 1000 | change it ourselves. */ | 1001 | change it ourselves. */ |
| 1001 | #if defined (MATCH_MAY_ALLOCATE) | 1002 | #if defined (MATCH_MAY_ALLOCATE) |
| 1002 | int re_max_failures = 200000; | 1003 | int re_max_failures = 20000; |
| 1003 | #else | 1004 | #else |
| 1004 | int re_max_failures = 2000; | 1005 | int re_max_failures = 2000; |
| 1005 | #endif | 1006 | #endif |
| @@ -1155,7 +1156,7 @@ typedef struct | |||
| 1155 | /* Push the info, starting with the registers. */ \ | 1156 | /* Push the info, starting with the registers. */ \ |
| 1156 | DEBUG_PRINT1 ("\n"); \ | 1157 | DEBUG_PRINT1 ("\n"); \ |
| 1157 | \ | 1158 | \ |
| 1158 | if (!(RE_NO_POSIX_BACKTRACKING & bufp->syntax)) \ | 1159 | if (1) \ |
| 1159 | for (this_reg = lowest_active_reg; this_reg <= highest_active_reg; \ | 1160 | for (this_reg = lowest_active_reg; this_reg <= highest_active_reg; \ |
| 1160 | this_reg++) \ | 1161 | this_reg++) \ |
| 1161 | { \ | 1162 | { \ |
| @@ -1216,7 +1217,7 @@ typedef struct | |||
| 1216 | 1217 | ||
| 1217 | /* We actually push this many items. */ | 1218 | /* We actually push this many items. */ |
| 1218 | #define NUM_FAILURE_ITEMS \ | 1219 | #define NUM_FAILURE_ITEMS \ |
| 1219 | (((RE_NO_POSIX_BACKTRACKING & bufp->syntax \ | 1220 | (((0 \ |
| 1220 | ? 0 : highest_active_reg - lowest_active_reg + 1) \ | 1221 | ? 0 : highest_active_reg - lowest_active_reg + 1) \ |
| 1221 | * NUM_REG_ITEMS) \ | 1222 | * NUM_REG_ITEMS) \ |
| 1222 | + NUM_NONREG_ITEMS) | 1223 | + NUM_NONREG_ITEMS) |
| @@ -1277,7 +1278,7 @@ typedef struct | |||
| 1277 | low_reg = (unsigned) POP_FAILURE_INT (); \ | 1278 | low_reg = (unsigned) POP_FAILURE_INT (); \ |
| 1278 | DEBUG_PRINT2 (" Popping low active reg: %d\n", low_reg); \ | 1279 | DEBUG_PRINT2 (" Popping low active reg: %d\n", low_reg); \ |
| 1279 | \ | 1280 | \ |
| 1280 | if (!(RE_NO_POSIX_BACKTRACKING & bufp->syntax)) \ | 1281 | if (1) \ |
| 1281 | for (this_reg = high_reg; this_reg >= low_reg; this_reg--) \ | 1282 | for (this_reg = high_reg; this_reg >= low_reg; this_reg--) \ |
| 1282 | { \ | 1283 | { \ |
| 1283 | DEBUG_PRINT2 (" Popping reg: %d\n", this_reg); \ | 1284 | DEBUG_PRINT2 (" Popping reg: %d\n", this_reg); \ |