Partiy implement long filename support

example filefilefile.txt can store now with cdmake
but not filefilefiles.txt have not check why it say not a iso9660 name 


svn path=/trunk/; revision=15301
This commit is contained in:
Magnus Olsen 2005-05-15 10:33:33 +00:00
parent ac178266c3
commit f20d4d059e

View file

@ -19,6 +19,10 @@
* - No Joliet file name validations
* - Very bad ISO file name generation
*
*
* convert long filename to iso9660 file name by Magnus Olsen
* magnus@greatlord.com
*
* $Id$
*/
@ -547,7 +551,8 @@ void parse_filename_into_dirrecord ( const char* filename, PDIR_RECORD d, BOOL d
char *t = d->name_on_cd;
char *n = d->name;
int joliet_length;
int filename_counter;
filename_counter = 1;
while (*s != 0)
{
if (*s == '.')
@ -597,9 +602,27 @@ void parse_filename_into_dirrecord ( const char* filename, PDIR_RECORD d, BOOL d
} else
d->flags = 0;
if ( cdname_exists ( d ) )
filename_counter = 1;
while ( cdname_exists ( d ) )
{
// the file name must be least 8 char long
if (strlen(d->name_on_cd)<8)
error_exit ( "'%s' is a duplicate file name, aborting...", filename );
if ((d->name_on_cd[8] == '.') && (strlen(d->name_on_cd) < 13))
error_exit ( "'%s' is a duplicate file name, aborting...", filename );
// max 255 times for equal short filename
if (filename_counter>255) error_exit ( "'%s' is a duplicate file name, aborting...", filename );
d->name_on_cd[8] = '~';
memset(&d->name_on_cd[9],0,5);
itoa(filename_counter, &d->name_on_cd[9],10);
filename_counter++;
}
if ( joliet )
{
joliet_length = strlen(filename);
@ -1641,4 +1664,5 @@ int main(int argc, char **argv)
return 0;
}
/* EOF */