Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam 2019-11-24 20:01:24 +00:00
commit 81d4f95c2f

View File

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