Two followups for recent commits (#41457)
This commit is contained in:
@@ -2604,16 +2604,24 @@ int terminal_get_size(
|
||||
|
||||
if (try_csi18) {
|
||||
r = terminal_query_size_by_csi18(nonblock_input_fd, output_fd, ret_rows, ret_columns);
|
||||
if (!IN_SET(r, -EOPNOTSUPP, -EINVAL) || !try_dsr)
|
||||
if (r >= 0)
|
||||
return r;
|
||||
|
||||
/* CSI 18 query failed. Flush input before trying the DSR fallback — a late CSI 18 response
|
||||
* may have landed in the input queue and would confuse the DSR response parser. */
|
||||
/* Query failed. Flush any outstanding input. */
|
||||
(void) tcflush(nonblock_input_fd, TCIFLUSH);
|
||||
|
||||
if (!IN_SET(r, -EOPNOTSUPP, -EINVAL))
|
||||
return r;
|
||||
}
|
||||
|
||||
if (try_dsr)
|
||||
if (try_dsr) {
|
||||
r = terminal_query_size_by_dsr(nonblock_input_fd, output_fd, ret_rows, ret_columns);
|
||||
if (r >= 0)
|
||||
return r;
|
||||
|
||||
/* Query failed. Flush any outstanding input. */
|
||||
(void) tcflush(nonblock_input_fd, TCIFLUSH);
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -475,6 +475,12 @@ TEST(efi_fnmatch) {
|
||||
TEST_FNMATCH_ONE_MAY_SKIP_LIBC("[a\\-z]", "b", false);
|
||||
TEST_FNMATCH_ONE("?a*b[.-0]c", "/a/b/c", true);
|
||||
TEST_FNMATCH_ONE("debian-*-*-*.*", "debian-jessie-2018-06-17-kernel-image-5.10.0-16-amd64.efi", true);
|
||||
TEST_FNMATCH_ONE("console=*", "console=xxx", true);
|
||||
TEST_FNMATCH_ONE("* console=*", "opt1 console=ttyS0 opt2", true);
|
||||
TEST_FNMATCH_ONE("console=*", " console=xxx", false);
|
||||
TEST_FNMATCH_ONE("* console=", "opt1 console=ttyS0 opt2", false);
|
||||
TEST_FNMATCH_ONE("console=*", "netconsole=@/eth0,@10.0.0.1/", false);
|
||||
TEST_FNMATCH_ONE("* console=*", "netconsole=@/eth0,@10.0.0.1/", false);
|
||||
|
||||
/* These would take forever with a backtracking implementation. */
|
||||
TEST_FNMATCH_ONE(
|
||||
|
||||
Reference in New Issue
Block a user