summaryrefslogtreecommitdiff
path: root/src/regexp.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2009-02-21 21:04:20 +0000
committerBram Moolenaar <Bram@vim.org>2009-02-21 21:04:20 +0000
commit7670fa0ef1c23a80d6a016fd83d0ba655fb91b3d (patch)
treeeae4f1e933d313e45f367cec159c4bbe5344c633 /src/regexp.c
parentfa363cd16f9ef3248331165f9d45fa3b648e7e5c (diff)
downloadvim-git-7670fa0ef1c23a80d6a016fd83d0ba655fb91b3d.tar.gz
updated for version 7.2-113v7.2.113
Diffstat (limited to 'src/regexp.c')
-rw-r--r--src/regexp.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/regexp.c b/src/regexp.c
index ac60c695a..00df12d54 100644
--- a/src/regexp.c
+++ b/src/regexp.c
@@ -4532,7 +4532,7 @@ regmatch(scan)
cleanup_subexpr();
if (!REG_MULTI) /* Single-line regexp */
{
- if (reg_endp[no] == NULL)
+ if (reg_startp[no] == NULL || reg_endp[no] == NULL)
{
/* Backref was not set: Match an empty string. */
len = 0;
@@ -4548,7 +4548,7 @@ regmatch(scan)
}
else /* Multi-line regexp */
{
- if (reg_endpos[no].lnum < 0)
+ if (reg_startpos[no].lnum < 0 || reg_endpos[no].lnum < 0)
{
/* Backref was not set: Match an empty string. */
len = 0;
@@ -7279,13 +7279,11 @@ reg_submatch(no)
}
else
{
- if (submatch_match->endp[no] == NULL)
+ s = submatch_match->startp[no];
+ if (s == NULL || submatch_match->endp[no] == NULL)
retval = NULL;
else
- {
- s = submatch_match->startp[no];
retval = vim_strnsave(s, (int)(submatch_match->endp[no] - s));
- }
}
return retval;