Fix xperm parsing logic

This commit is contained in:
topjohnwu
2024-03-20 23:13:54 -07:00
parent d654b9cb97
commit a9ee2d7d18
2 changed files with 10 additions and 6 deletions
+6 -2
View File
@@ -164,7 +164,11 @@ fn xperm_to_string(perm: &ffi::Xperm) -> String {
if perm.reset {
s.push('~');
}
s.write_fmt(format_args!("{{ {:#06x}-{:#06x} }}", perm.low, perm.high))
.ok();
if perm.low == perm.high {
s.write_fmt(format_args!("{{ {:#06X} }}", perm.low)).ok();
} else {
s.write_fmt(format_args!("{{ {:#06X}-{:#06X} }}", perm.low, perm.high))
.ok();
}
s
}