1
Fork 0
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:
Will Shuttleworth 2025-06-16 03:45:11 -04:00 committed by GitHub
parent 6023888363
commit 01ac6dfd18
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 37 additions and 3 deletions

View file

@ -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);
}