[xiph-commits] r17017 - trunk/vorbis-tools/vcut

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Wed Mar 24 01:34:27 PDT 2010


Author: xiphmont
Date: 2010-03-24 01:34:27 -0700 (Wed, 24 Mar 2010)
New Revision: 17017

Modified:
   trunk/vorbis-tools/vcut/vcut.c
Log:
Closes Trac #1645


Modified: trunk/vorbis-tools/vcut/vcut.c
===================================================================
--- trunk/vorbis-tools/vcut/vcut.c	2010-03-24 08:28:33 UTC (rev 17016)
+++ trunk/vorbis-tools/vcut/vcut.c	2010-03-24 08:34:27 UTC (rev 17017)
@@ -216,7 +216,10 @@
 
 	else
 	{
-		s->out = fopen(filename, "wb");
+                if(strcmp(filename, "-") == 0)
+                        s->out = fdopen(1, "wb");
+                else
+                        s->out = fopen(filename, "wb");
 		s->drop_output = 0;
 		if(!s->out) {
 			fprintf(stderr, _("Couldn't open %s for writing\n"), filename);
@@ -266,11 +269,15 @@
 	}
 
 	state.in = fopen(argv[1], "rb");
+        if(strcmp(argv[1], "-") == 0)
+                state.in = fdopen(0, "rb");
+        else
+                state.in = fopen(argv[1], "rb");
 	if(!state.in) {
 		fprintf(stderr, _("Couldn't open %s for reading\n"), argv[1]);
 		exit(1);
 	}
-	
+
 	state.output_filename = argv[2];
 	seg = vcut_malloc(sizeof(vcut_segment));
 	if(!seg)



More information about the commits mailing list