mirror of
https://github.com/tmux/tmux.git
synced 2026-10-06 17:49:52 +00:00
Copy all #s at once when multiple are seen before [ rather than only
copying one at a time which can be very slow.
This commit is contained in:
15
format.c
15
format.c
@@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: format.c,v 1.419 2026/09/28 16:00:28 nicm Exp $ */
|
||||
/* $OpenBSD: format.c,v 1.420 2026/09/28 16:23:56 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||
@@ -6805,6 +6805,19 @@ format_expand1(struct format_expand_state *es, const char *fmt)
|
||||
fmt = ptr + 1;
|
||||
continue;
|
||||
}
|
||||
if (ch == '#') {
|
||||
while (len - off < (n / 2) + 1) {
|
||||
buf = xreallocarray(buf, 2, len);
|
||||
len *= 2;
|
||||
}
|
||||
memset(buf + off, '#', n / 2);
|
||||
off += (n / 2);
|
||||
if (n % 2 != 0)
|
||||
fmt = ptr - 1;
|
||||
else
|
||||
fmt = ptr;
|
||||
continue;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
case '}':
|
||||
case ',':
|
||||
|
||||
Reference in New Issue
Block a user