shithub: sox

Download patch

ref: d3662cf1b3f34c7c93561979fc22e762bd29be06
parent: 1fbfe47ea1e89bf12b69fee4697811471a48e583
author: robs <robs>
date: Sun Jun 14 09:38:44 EDT 2009

trap lone '-' argument; better space usage

--- a/src/gain.c
+++ b/src/gain.c
@@ -35,8 +35,8 @@
 {
   priv_t * p = (priv_t *)effp->priv;
   char const * q;
-  for (--argc, ++argv; argc && **argv == '-' && !isdigit(argv[0][1]) &&
-      argv[0][1] != '.'; --argc, ++argv)
+  for (--argc, ++argv; argc && **argv == '-' && argv[0][1] &&
+      !isdigit(argv[0][1]) && argv[0][1] != '.'; --argc, ++argv)
     for (q = &argv[0][1]; *q; ++q) switch (*q) {
       case 'n': p->do_scan = p->do_normalise = sox_true; break;
       case 'e': p->do_scan = p->do_equalise = sox_true; break;
@@ -231,16 +231,16 @@
     create, start, flow, drain, stop, NULL, sizeof(priv_t)};
   static char const * lines[] = {
     "[-e|-b|-B|-r] [-n] [-l|-h] [gain-dB]",
-    "-e\tEqualise channels: peak to that with max peak;",
-    "-B\tBalance channels: rms to that with max rms; no clip protection",
-    "-b\tBalance channels: rms to that with max rms; clip protection",
-    "\t  Note -Bn = -bn",
-    "-r\tReclaim headroom (as much as possible without clipping); see -h",
-    "-n\tNorm file to 0dBfs(output precision); gain-dB, if present, usually <0",
-    "-l\tUse simple limiter",
-    "-h\tApply attenuation for headroom for subsequent effects;",
-    "\t  gain-dB, if present is subject to reclaim by a subsequent gain -r",
-    "gain-dB\tApply gain in dB",
+    "-e\t Equalise channels: peak to that with max peak;",
+    "-B\t Balance channels: rms to that with max rms; no clip protection",
+    "-b\t Balance channels: rms to that with max rms; clip protection",
+    "\t   Note -Bn = -bn",
+    "-r\t Reclaim headroom (as much as possible without clipping); see -h",
+    "-n\t Norm file to 0dBfs(output precision); gain-dB, if present, usually <0",
+    "-l\t Use simple limiter",
+    "-h\t Apply attenuation for headroom for subsequent effects; gain-dB, if",
+    "\t   present, is subject to reclaim by a subsequent gain -r",
+    "gain-dB\t Apply gain in dB",
   };
   static char * usage;
   handler.usage = lsx_usage_lines(&usage, lines, array_length(lines));