-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libterm: parse extended terminfo format #68036
Conversation
r? @KodrAus (rust_highfive has picked a reviewer for you, use r? to override) |
fn read_le_u32(r: &mut dyn io::Read) -> io::Result<u32> { | ||
let mut b = [0; 4]; | ||
let mut amt = 0; | ||
while amt < b.len() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be able to use read_exact(&mut b)
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
caf3f3b
to
f9a5746
Compare
@bors r+ |
📌 Commit f9a5746 has been approved by |
fn read_le_u32(r: &mut dyn io::Read) -> io::Result<u32> { | ||
let mut b = [0; 4]; | ||
r.read_exact(&mut b)?; | ||
Ok((b[0] as u32) | ((b[1] as u32) << 8) | ((b[2] as u32) << 16) | ((b[3] as u32) << 24)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok((b[0] as u32) | ((b[1] as u32) << 8) | ((b[2] as u32) << 16) | ((b[3] as u32) << 24)) | |
Ok(u32::from_le_bytes(b)) |
n => amt += n, | ||
} | ||
} | ||
r.read_exact(&mut b)?; | ||
Ok((b[0] as u16) | ((b[1] as u16) << 8)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok((b[0] as u16) | ((b[1] as u16) << 8)) | |
Ok(u16::from_le_bytes(b)) |
libterm: parse extended terminfo format Fixes rust-lang#45728. Modifies libterm to parse the extended terminfo format introduced in ncurses 6.1. This fixes the lack of color in test output for users with newer ncurses versions. The ideal fix for this would be to migrate libtest to use `termcolor` (rust-lang#60349), but that's blocked for the foreseeable future.
libterm: parse extended terminfo format Fixes rust-lang#45728. Modifies libterm to parse the extended terminfo format introduced in ncurses 6.1. This fixes the lack of color in test output for users with newer ncurses versions. The ideal fix for this would be to migrate libtest to use `termcolor` (rust-lang#60349), but that's blocked for the foreseeable future.
libterm: parse extended terminfo format Fixes rust-lang#45728. Modifies libterm to parse the extended terminfo format introduced in ncurses 6.1. This fixes the lack of color in test output for users with newer ncurses versions. The ideal fix for this would be to migrate libtest to use `termcolor` (rust-lang#60349), but that's blocked for the foreseeable future.
Rollup of 10 pull requests Successful merges: - #67854 (Use `report_in_external_macro` for internal lints) - #67989 (rustdoc: Don't allow `#![feature(...)]` on stable or beta) - #68036 (libterm: parse extended terminfo format) - #68127 (Clarify the relationship between `extended` and `tools` in `config.toml`) - #68143 (Forbid elided lifetimes within const generic parameter types) - #68150 (Document behavior of set_nonblocking on UnixListener) - #68166 (rustdoc: HTML escape arrows on help popup) - #68176 (Clean up err codes) - #68179 (Remove unneeded scope) - #68188 (Tweak assertion note in format check) Failed merges: r? @ghost
Fixes #45728.
Modifies libterm to parse the extended terminfo format introduced in ncurses 6.1. This fixes the lack of color in test output for users with newer ncurses versions.
The ideal fix for this would be to migrate libtest to use
termcolor
(#60349), but that's blocked for the foreseeable future.