[MPlayer-cvslog] r32776 - trunk/TOOLS/avisubdump.c

Reinhard Tartler siretart at tauware.de
Mon Jan 10 12:31:25 CET 2011


On Mon, Jan 10, 2011 at 08:33:38 (CET), Reimar Döffinger wrote:

> On Mon, Jan 10, 2011 at 07:17:24AM +0100, Reinhard Tartler wrote:
>> On Sun, Jan 09, 2011 at 23:05:03 (CET), Reimar Döffinger wrote:
>> > On Sun, Jan 09, 2011 at 09:21:46PM +0100, siretart wrote:
>> >> Modified: trunk/TOOLS/avisubdump.c
>> >> ==============================================================================
>> >> --- trunk/TOOLS/avisubdump.c	Sun Jan  9 21:03:56 2011	(r32775)
>> >> +++ trunk/TOOLS/avisubdump.c	Sun Jan  9 21:21:45 2011	(r32776)
>> >> @@ -180,8 +180,12 @@ int main(int argc,char* argv[])
>> >>  		exit(1);
>> >>  	}
>> >>  
>> >> -	if (strcmp(argv[argc-1], "-") == 0) f=stdin;
>> >> -	else f=fopen(argv[argc-1],"rb");
>> >> +	if (strcmp(argv[argc-1], "-") == 0) {
>> >> +		dump(stdin);
>> >> +		return 0;
>> >> +	}
>> >> +
>> >> +	f=fopen(argv[argc-1],"rb");
>> >>  
>> >>  	if (!f) {
>> >>  		fprintf(stderr, "Could not open '%s': %s\n",
>> >> @@ -190,6 +194,7 @@ int main(int argc,char* argv[])
>> >>  	}
>> >>  
>> >>  	dump(f);
>> >> +	fclose(f);
>> >>  
>> >>  	return 0;
>> >
>> > It's not an important tool, but I don't like added code duplication for no gain.
>> > The fclose after all serves no purpose at all except satisfying such
>> > tools.
>> 
>> Do you want me to revert this?
>
> No, not necessary.
>
>> btw, the only duplication is the call to 'dump(f)' and 'return 0;'.
>
> Right now, but if it was maintained code more would surely be added, and certainly
> forgotten in one code path.

Be assured that if that was case, I would surely have taken a more
sophisticated approach.

-- 
Gruesse/greetings,
Reinhard Tartler, KeyID 945348A4



More information about the MPlayer-cvslog mailing list