In the channel selection loop, "if (TT.chan)" had been combined with
a strcmp; the else conditionals were premised on if (TT.chan) alone.

The help text had been only partially updated for a couple option changes.
---
 toys/other/mix.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/toys/other/mix.c b/toys/other/mix.c
index 2b8165e..5bc10b1 100644
--- a/toys/other/mix.c
+++ b/toys/other/mix.c
@@ -9,13 +9,13 @@ config MIX
   bool "mix"
   default y
   help
-   usage: mix [-m DEV] [-d CHANNEL] [-l VOL] [-r RIGHT]
+   usage: mix [-d DEV] [-c CHANNEL] [-l VOL] [-r RIGHT]
 
    List OSS sound channels (module snd-mixer-oss), or set volume(s).
 
+   -c CHANNEL  Set/show volume of CHANNEL (default first channel found)
    -d DEV              Device node (default /dev/mixer)
    -l VOL              Volume level
-   -c CHANNEL  Set/show volume of CHANNEL (default first channel found)
    -r RIGHT    Volume of right stereo channel (with -r, -l sets left volume)
 */
 
@@ -41,9 +41,11 @@ void mix_main(void)
 
   for (channel = 0; channel < SOUND_MIXER_NRDEVICES; channel++) {
     if ((1<<channel) & mask) {
-      if (TT.chan && !strcmp(channels[channel], TT.chan)) break;
-      else if (toys.optflags & FLAG_l) break;
-      else printf("%s\n", channels[channel]);
+      if (TT.chan) {
+        if (!strcmp(channels[channel], TT.chan)) break;
+      } else if (toys.optflags & FLAG_l) {
+        break;
+      } else printf("%s\n", channels[channel]);
     }
   }
 
-- 
2.2.0

_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to