Ignore:
Timestamp:
08/04/09 22:11:46 (15 years ago)
Author:
r2d
Message:

libmpc (mpcenc) :

  • improved file extension conversion to .mpc
  • version 1.30.1
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libmpc/trunk/mpcenc/mpcenc.c

    r435 r452  
    841841    // if no Output-File is stated, set OutFile to InFile.mpc
    842842    if ( *OutputFile == NULL  ) {
     843            char * ext = rindex(*InputFile, '.'); // search for extension delimiter
    843844        strcpy ( *OutputFile = output, *InputFile );
    844845        len = strlen ( output );
    845         if ( len > 4  &&  output[len-4] == '.' )
    846             len -= 4;
     846                if (ext != 0 && (len - (ext - *InputFile)) < 7) // extension max size (5 chars)
     847                        len = ext - *InputFile;
    847848        strcpy (output+len, ".mpc");
    848849        argc -= 1;
Note: See TracChangeset for help on using the changeset viewer.