readlink: note that our -f is really -e
[oweals/busybox.git] / coreutils / stty.c
index af2347161f1be8cb0514737d0a9d524c7ade2c20..96754dd84029fbe3d0a4dbf865f4f4f96bf8d0ca 100644 (file)
@@ -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 */