diff options
author | 2020-05-17 05:39:32 +0000 | |
---|---|---|
committer | 2020-05-17 05:39:32 +0000 | |
commit | 6ce0bcf944227beda8aae9586959632f47fb5534 (patch) | |
tree | 9c8abf73bb5c57d0af7ff1b466476e8711ee2a39 /usr.bin/sndioctl | |
parent | When -m is used, don't print controls that didn't change (diff) | |
download | wireguard-openbsd-6ce0bcf944227beda8aae9586959632f47fb5534.tar.xz wireguard-openbsd-6ce0bcf944227beda8aae9586959632f47fb5534.zip |
Print lists as comma-separated items
Diffstat (limited to 'usr.bin/sndioctl')
-rw-r--r-- | usr.bin/sndioctl/sndioctl.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/usr.bin/sndioctl/sndioctl.c b/usr.bin/sndioctl/sndioctl.c index 25c5b54f1f4..d919122fe9c 100644 --- a/usr.bin/sndioctl/sndioctl.c +++ b/usr.bin/sndioctl/sndioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sndioctl.c,v 1.9 2020/05/17 05:37:49 ratchov Exp $ */ +/* $OpenBSD: sndioctl.c,v 1.10 2020/05/17 05:39:32 ratchov Exp $ */ /* * Copyright (c) 2014-2020 Alexandre Ratchov <alex@caoua.org> * @@ -432,12 +432,21 @@ print_val(struct info *p, int mono) if (e != firstent(p, e->desc.node1.name)) continue; } - if (more) - printf(","); - print_node(&e->desc.node1, mono); - printf(":"); - print_num(e); - more = 1; + if (e->desc.maxval == 1) { + if (e->curval) { + if (more) + printf(","); + print_node(&e->desc.node1, mono); + more = 1; + } + } else { + if (more) + printf(","); + print_node(&e->desc.node1, mono); + printf(":"); + print_num(e); + more = 1; + } } } } |