summaryrefslogtreecommitdiffstats
path: root/src/eval.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2008-07-14 21:05:15 +0000
committerBram Moolenaar <Bram@vim.org>2008-07-14 21:05:15 +0000
commit9c24ccc7b8f70901bbedb177eeb0efc2e84182e8 (patch)
tree07bc65e8a8a2f06c5e54732753c270962ebc0409 /src/eval.c
parentaf51e66c5ae4a73f4b05f3feb9bb539431ea2d44 (diff)
updated for version 7.2b-004v7.2b.004
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/eval.c b/src/eval.c
index 18c8329df9..bb25044948 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -14997,7 +14997,7 @@ do_searchpair(spat, mpat, epat, dir, skip, flags, match_pos,
/* Make 'cpoptions' empty, the 'l' flag should not be used here. */
save_cpo = p_cpo;
- p_cpo = (char_u *)"";
+ p_cpo = empty_option;
#ifdef FEAT_RELTIME
/* Set the time limit, if there is one. */
@@ -15112,7 +15112,11 @@ do_searchpair(spat, mpat, epat, dir, skip, flags, match_pos,
theend:
vim_free(pat2);
vim_free(pat3);
- p_cpo = save_cpo;
+ if (p_cpo == empty_option)
+ p_cpo = save_cpo;
+ else
+ /* Darn, evaluating the {skip} expression changed the value. */
+ free_string_option(save_cpo);
return retval;
}
@@ -22503,7 +22507,7 @@ do_string_sub(str, pat, sub, flags)
/* Make 'cpoptions' empty, so that the 'l' flag doesn't work here */
save_cpo = p_cpo;
- p_cpo = (char_u *)"";
+ p_cpo = empty_option;
ga_init2(&ga, 1, 200);
@@ -22564,7 +22568,11 @@ do_string_sub(str, pat, sub, flags)
ret = vim_strsave(ga.ga_data == NULL ? str : (char_u *)ga.ga_data);
ga_clear(&ga);
- p_cpo = save_cpo;
+ if (p_cpo == empty_option)
+ p_cpo = save_cpo;
+ else
+ /* Darn, evaluating {sub} expression changed the value. */
+ free_string_option(save_cpo);
return ret;
}