From 4531f689ff2fa976ffcbfadd329a1b3c903c00af Mon Sep 17 00:00:00 2001 From: Daniel Bertalan Date: Thu, 10 Jun 2021 22:33:03 +0200 Subject: [PATCH] Userland: Fix incorrect iflag/oflag printing in `stty` The `c_iflag` and `c_oflag` fields were swapped in the source code which caused the bit values to be interpreted as the wrong flag. It was a stupid mistake on my part. --- Userland/Utilities/stty.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Utilities/stty.cpp b/Userland/Utilities/stty.cpp index d20c0a2c0b..5f08b28fb7 100644 --- a/Userland/Utilities/stty.cpp +++ b/Userland/Utilities/stty.cpp @@ -240,9 +240,9 @@ void print_human_readable(const termios& modes, const winsize& ws, bool verbose_ }; auto print_flags = [&] { - print_flags_of_type(all_cflags, sizeof(all_cflags) / sizeof(TermiosFlag), modes.c_iflag, TTYDEF_CFLAG); + print_flags_of_type(all_cflags, sizeof(all_cflags) / sizeof(TermiosFlag), modes.c_cflag, TTYDEF_CFLAG); print_flags_of_type(all_oflags, sizeof(all_oflags) / sizeof(TermiosFlag), modes.c_oflag, TTYDEF_OFLAG); - print_flags_of_type(all_iflags, sizeof(all_iflags) / sizeof(TermiosFlag), modes.c_cflag, TTYDEF_IFLAG); + print_flags_of_type(all_iflags, sizeof(all_iflags) / sizeof(TermiosFlag), modes.c_iflag, TTYDEF_IFLAG); print_flags_of_type(all_lflags, sizeof(all_lflags) / sizeof(TermiosFlag), modes.c_lflag, TTYDEF_LFLAG); };