Merge branch 'obsd-master'

pull/1985/head
Thomas Adam 2019-11-24 20:01:24 +00:00
commit 81d4f95c2f
1 changed files with 6 additions and 0 deletions

View File

@ -107,6 +107,12 @@ regsub(const char *pattern, const char *with, const char *text, int flags)
start = m[0].rm_eo + 1;
empty = 1;
}
/* Stop now if anchored to start. */
if (*pattern == '^') {
regsub_copy(&buf, &len, text, start, end);
break;
}
}
buf[len] = '\0';