From d9ec7993f9705a100043fc890eaa050bcba05349 Mon Sep 17 00:00:00 2001 From: germeier Date: Tue, 24 Sep 2002 15:38:03 +0000 Subject: fixed issues with 8.3 names in directory.c actually use mpio_filetype_t to tag files during writing of internal memory writing of Config.dat does work now (though it needs some code in mpiosh) --- libmpio/directory.c | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) (limited to 'libmpio/directory.c') diff --git a/libmpio/directory.c b/libmpio/directory.c index 0991cc1..ea51ac3 100644 --- a/libmpio/directory.c +++ b/libmpio/directory.c @@ -1,6 +1,6 @@ /* * - * $Id: directory.c,v 1.6 2002/09/14 22:54:41 germeier Exp $ + * $Id: directory.c,v 1.7 2002/09/24 15:38:03 germeier Exp $ * * Library for USB MPIO-* * @@ -414,7 +414,7 @@ mpio_dentry_get_startcluster(mpio_t *m, mpio_mem_t mem, BYTE *p) if (cluster < 0) return NULL; - new = mpio_fatentry_new(m, mem, cluster); + new = mpio_fatentry_new(m, mem, cluster, FTYPE_MUSIC); if (mem == MPIO_INTERNAL_MEM) { @@ -515,8 +515,6 @@ mpio_dentry_put(mpio_t *m, mpio_mem_t mem, /* find uniq 8.3 filename */ memset(f_8_3, 0x20, 12); - f_8_3[6]='~'; - f_8_3[7]='1'; f_8_3[8]='.'; f_8_3[12]=0x00; @@ -540,6 +538,12 @@ mpio_dentry_put(mpio_t *m, mpio_mem_t mem, j++; } + if (mpio_dentry_find_name_8_3(m, mem, f_8_3)) + { + f_8_3[6]='~'; + f_8_3[7]='1'; + } + while(mpio_dentry_find_name_8_3(m, mem, f_8_3)) f_8_3[7]++; @@ -597,8 +601,25 @@ mpio_dentry_find_name_8_3(mpio_t *m, BYTE mem, BYTE *filename) WORD wdummy; BYTE fname[129]; BYTE fname_8_3[13]; + BYTE filename_8_3[13]; DWORD ddummy; BYTE *found = 0; + int i, j, len; + + /* format given filename to a "standard" 8.3 filename */ + memset(filename_8_3, 0x20, 13); + filename_8_3[12]=0; + len=strlen(filename); + i=j=0; + while ((i<13) && (j