[xiph-commits] r6837 - trunk/vorbis-tools/oggenc

msmith at dactyl.lonelymoon.com msmith
Fri Jun 25 13:44:27 PDT 2004


Author: msmith
Date: Fri Jun 25 13:44:27 2004
New Revision: 6837

Modified:
trunk/vorbis-tools/oggenc/oggenc.c
Log:
Fix bug where oggenc would create an output filename identical to the input
filename, then accept it and truncate the input file.

Also fix an option default/bug that meant that "oggenc blah.wav" didn't work.



Modified: trunk/vorbis-tools/oggenc/oggenc.c
===================================================================
--- trunk/vorbis-tools/oggenc/oggenc.c	2004-06-20 04:52:29 UTC (rev 6836)
+++ trunk/vorbis-tools/oggenc/oggenc.c	2004-06-21 02:08:41 UTC (rev 6837)
@@ -79,7 +79,7 @@
oe_options opt = {NULL, 0, NULL, 0, NULL, 0, NULL, 0, NULL,
0, NULL, 0, NULL, 0, NULL, 0, 1, 0, 0,16,44100,2, 0, NULL,
DEFAULT_NAMEFMT_REMOVE, DEFAULT_NAMEFMT_REPLACE,
-			  NULL, 0, -1,-1,-1,-.3,-1,0, 0,0.f, 0};
+			  NULL, 0, -1,-1,-1,.3,-1,0, 0,0.f, 0};

int i;

@@ -274,6 +274,13 @@
continue;
}

+            if(infiles[i] && !strcmp(infiles[i], out_fn)) {
+                fprintf(stderr, _("ERROR: Input filename is the same as output filename \"%s\"\n"), out_fn);
+                errors++;
+                free(out_fn);
+                continue;
+            }
+
out = fopen(out_fn, "wb");
if(out == NULL)
{



More information about the commits mailing list