aboutsummaryrefslogtreecommitdiff
path: root/toys/pending/stty.c
AgeCommit message (Collapse)Author
2020-05-08Inline do_main(), remove second argument of get_arg() that's always 0Rob Landley
(one caller fed in N_TTY which is 0).
2020-05-08stty.c: fix interpreting output of stty -gEthan Sommer
move case checking for stty -g output as input above case checking for an int argument, so atoi doesn't cause "500:5:bf:8a3b:3"... to be considered an int argument of 500
2018-12-04Clean up some --help formatting.Elliott Hughes
Be consistent about upper versus lower case. (Upper seems to have the majority, so I went with that, though I'm happy to provide the opposite patch as long as we're consistent!) Be consistent about using \t. (Though saving a few bytes seems like it might be better done in the code that generates help.h rather than directly in the source, since tabs make careful ASCII art layout hard enough that we regularly have things misaligned.) Remove trailing periods (most of which seem to have been added by me). Always use the US "human readable" rather than my British "human-readable", and be more consistent about declaring whether we're showing multiples of 1000 or 1024. Just say "verbose" rather than adding a useless "mode" or "output".
2017-12-10Cleanup pass on stty: collate do_stty() calls for future inlining,Rob Landley
collapse flag arrays to fewer lines, factor out xtcgetattr(), strip curly brackets around single lines, don't have a separate error message for tcsetattr() return code if more thorough check is on next line, take advantage of O_RDONLY being zero, document -F.
2017-12-05Use NULL rather than 0 in vargs.Elliott Hughes
Top bits count too!
2017-12-03Commands in pending should default n.Rob Landley
2017-12-03Add stty(1).Elliott Hughes
Full POSIX stty with Linux extensions. Output and behavior match coreutils 8.26 as far as I can tell. For some reason busybox 1.22 stty always shows all the special characters, even when they match "sane". I've matched coreutils, since "shows differences from sane" is easy to describe and obviously useful. Flags in the various arrays are not in the order they're introduced in POSIX or in the Linux header file: they're in the order that they're output by coreutils' stty. The -g output matches coreutils and busybox. I implemented iuclc, xcase, and olcuc even though they've been removed from POSIX because the others implement them, and "man stty" defines "raw" and "sane" in terms of them (where POSIX doesn't define "sane" in any useful sense). This builds fine against glibc 2.24, and as far as I can tell all the constants used were in Linux 2.6 so I'm assuming that there shouldn't be any #ifdef nonsense needed for any reasonable vintage of C library.