X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=coreutils%2Fstty.c;h=96754dd84029fbe3d0a4dbf865f4f4f96bf8d0ca;hb=1b49c25e0a719ec3051eafa2329e68012c815abb;hp=af2347161f1be8cb0514737d0a9d524c7ade2c20;hpb=34425389e09353a8dacdd6b23a62553f699c544c;p=oweals%2Fbusybox.git diff --git a/coreutils/stty.c b/coreutils/stty.c index af2347161..96754dd84 100644 --- a/coreutils/stty.c +++ b/coreutils/stty.c @@ -26,7 +26,6 @@ //usage:#define stty_full_usage "\n\n" //usage: "Without arguments, prints baud rate, line discipline,\n" //usage: "and deviations from stty sane\n" -//usage: "\nOptions:" //usage: "\n -F DEVICE Open device instead of stdin" //usage: "\n -a Print all current settings in human-readable form" //usage: "\n -g Print in stty-readable form" @@ -1057,7 +1056,7 @@ static void do_display(const struct termios *mode, int all) } #endif wrapf("%s = %s;", nth_string(control_name, i), - visible(mode->c_cc[control_info[i].offset])); + visible(mode->c_cc[control_info[i].offset])); } #if VEOF == VMIN if ((mode->c_lflag & ICANON) == 0) @@ -1405,13 +1404,15 @@ int stty_main(int argc UNUSED_PARAM, char **argv) /* Specifying both -a and -g is an error */ if ((stty_state & (STTY_verbose_output | STTY_recoverable_output)) == - (STTY_verbose_output | STTY_recoverable_output)) - bb_error_msg_and_die("verbose and stty-readable output styles are mutually exclusive"); + (STTY_verbose_output | STTY_recoverable_output) + ) { + bb_error_msg_and_die("-a and -g are mutually exclusive"); + } /* Specifying -a or -g with non-options is an error */ - if (!(stty_state & STTY_noargs) - && (stty_state & (STTY_verbose_output | STTY_recoverable_output)) + if ((stty_state & (STTY_verbose_output | STTY_recoverable_output)) + && !(stty_state & STTY_noargs) ) { - bb_error_msg_and_die("modes may not be set when specifying an output style"); + bb_error_msg_and_die("modes may not be set when -a or -g is used"); } /* Now it is safe to start doing things */