mirror of
https://github.com/tmux/tmux.git
synced 2025-01-26 07:58:55 +00:00
Only substitute patterns starting with ^ once.
This commit is contained in:
parent
3c312a9150
commit
20c1f1aec6
6
regsub.c
6
regsub.c
@ -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';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user