mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2026-01-15 01:31:08 +00:00
Merge pull request #8135 from willshuttleworth/stty-set-undefined
stty: fix mappings with empty string literal args
This commit is contained in:
parent
6023888363
commit
01ac6dfd18
2 changed files with 37 additions and 3 deletions
|
|
@ -598,7 +598,7 @@ fn apply_char_mapping(termios: &mut Termios, mapping: &(SpecialCharacterIndices,
|
|||
//
|
||||
// This function returns the ascii value of valid control chars, or ControlCharMappingError if invalid
|
||||
fn string_to_control_char(s: &str) -> Result<u8, ControlCharMappingError> {
|
||||
if s == "undef" || s == "^-" {
|
||||
if s == "undef" || s == "^-" || s.is_empty() {
|
||||
return Ok(0);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue