summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2008-06-15 12:21:50 +0000
committerBram Moolenaar <Bram@vim.org>2008-06-15 12:21:50 +0000
commitfde483c865055a98b77010d8668f763cc0fa701d (patch)
tree3966ea0b4854b278f5af67b7352374ccdbfa79e9 /src
parent7d96acd66bcb1dcb721715ef988825fc9d6b2f2e (diff)
downloadvim-fde483c865055a98b77010d8668f763cc0fa701d.zip
updated for version 7.1-315
Diffstat (limited to 'src')
-rw-r--r--src/regexp.c48
-rw-r--r--src/version.c2
2 files changed, 32 insertions, 18 deletions
diff --git a/src/regexp.c b/src/regexp.c
index 97181b862..6347eeda9 100644
--- a/src/regexp.c
+++ b/src/regexp.c
@@ -3044,6 +3044,7 @@ typedef struct regbehind_S
{
regsave_T save_after;
regsave_T save_behind;
+ int save_need_clear_subexpr;
save_se_T save_start[NSUBEXP];
save_se_T save_end[NSUBEXP];
} regbehind_T;
@@ -5858,17 +5859,23 @@ save_subexpr(bp)
{
int i;
- for (i = 0; i < NSUBEXP; ++i)
+ /* When "need_clear_subexpr" is set we don't need to save the values, only
+ * remember that this flag needs to be set again when restoring. */
+ bp->save_need_clear_subexpr = need_clear_subexpr;
+ if (!need_clear_subexpr)
{
- if (REG_MULTI)
- {
- bp->save_start[i].se_u.pos = reg_startpos[i];
- bp->save_end[i].se_u.pos = reg_endpos[i];
- }
- else
+ for (i = 0; i < NSUBEXP; ++i)
{
- bp->save_start[i].se_u.ptr = reg_startp[i];
- bp->save_end[i].se_u.ptr = reg_endp[i];
+ if (REG_MULTI)
+ {
+ bp->save_start[i].se_u.pos = reg_startpos[i];
+ bp->save_end[i].se_u.pos = reg_endpos[i];
+ }
+ else
+ {
+ bp->save_start[i].se_u.ptr = reg_startp[i];
+ bp->save_end[i].se_u.ptr = reg_endp[i];
+ }
}
}
}
@@ -5882,17 +5889,22 @@ restore_subexpr(bp)
{
int i;
- for (i = 0; i < NSUBEXP; ++i)
+ /* Only need to restore saved values when they are not to be cleared. */
+ need_clear_subexpr = bp->save_need_clear_subexpr;
+ if (!need_clear_subexpr)
{
- if (REG_MULTI)
- {
- reg_startpos[i] = bp->save_start[i].se_u.pos;
- reg_endpos[i] = bp->save_end[i].se_u.pos;
- }
- else
+ for (i = 0; i < NSUBEXP; ++i)
{
- reg_startp[i] = bp->save_start[i].se_u.ptr;
- reg_endp[i] = bp->save_end[i].se_u.ptr;
+ if (REG_MULTI)
+ {
+ reg_startpos[i] = bp->save_start[i].se_u.pos;
+ reg_endpos[i] = bp->save_end[i].se_u.pos;
+ }
+ else
+ {
+ reg_startp[i] = bp->save_start[i].se_u.ptr;
+ reg_endp[i] = bp->save_end[i].se_u.ptr;
+ }
}
}
}
diff --git a/src/version.c b/src/version.c
index 61a8944f8..aa283c4fc 100644
--- a/src/version.c
+++ b/src/version.c
@@ -667,6 +667,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 315,
+/**/
314,
/**/
313,