//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"
}
#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)
/* 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 */