[MPlayer-cvslog] r32776 - trunk/TOOLS/avisubdump.c
Reinhard Tartler
siretart at tauware.de
Mon Jan 10 07:17:24 CET 2011
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?
btw, the only duplication is the call to 'dump(f)' and 'return 0;'.
--
Gruesse/greetings,
Reinhard Tartler, KeyID 945348A4
More information about the MPlayer-cvslog
mailing list