shithub: sox

Download patch

ref: b794ba0c054718d46a4075b6a8a40e7c878b417c
parent: 408d02379e8af4663e1f42c3d6650e759be25864
author: robs <robs>
date: Sun Dec 24 04:22:55 EST 2006

Fix up logic that allows gopts between ofile & 1st effect

--- a/src/sox.c
+++ b/src/sox.c
@@ -278,10 +278,10 @@
       fo->filetype = "null";
       fo->filename = xstrdup(fo->filetype);
     } else {
-      if (optind >= argc) {
-        if (memcmp(fo, &fo_none, sizeof(fo_none)) != 0)
+      if (optind >= argc || is_effect_name(argv[optind])) {
+        if (memcmp(fo, &fo_none, sizeof(fo_none)) != 0) /* fopts but no file */
           usage("missing filename"); /* No return */
-        free(fo);
+        free(fo); /* No file opts and no filename, so that's okay */
         continue;
       }
       fo->filename = xstrdup(argv[optind++]);