Commit d1a10f90 authored by John Ballance's avatar John Ballance
Browse files

more bug fixes..

Detail:
   1: loading dir could occasionally blank the first dir entry.. lfn ptr
      blanking went too far
   2: long names and short names could get out of sync if the short
      name was changed on a non long name dosfs
Admin:
   castle tested
   castle added ip


Version 0.81. Tagged as 'DOSFS-0_81'
parent c91e9c18
/* (0.80)
/* (0.81)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.68.
*
*/
#define Module_MajorVersion_CMHG 0.80
#define Module_MajorVersion_CMHG 0.81
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 07 Oct 2004
#define Module_Date_CMHG 08 Oct 2004
#define Module_MajorVersion "0.80"
#define Module_Version 80
#define Module_MajorVersion "0.81"
#define Module_Version 81
#define Module_MinorVersion ""
#define Module_Date "07 Oct 2004"
#define Module_Date "08 Oct 2004"
#define Module_ApplicationDate "07-Oct-04"
#define Module_ApplicationDate "08-Oct-04"
#define Module_ComponentName "DOSFS"
#define Module_ComponentPath "RiscOS/Sources/FileSys/ImageFS/DOSFS"
#define Module_FullVersion "0.80"
#define Module_HelpVersion "0.80 (07 Oct 2004)"
#define Module_LibraryVersionInfo "0:80"
#define Module_FullVersion "0.81"
#define Module_HelpVersion "0.81 (08 Oct 2004)"
#define Module_LibraryVersionInfo "0:81"
......@@ -1428,7 +1428,7 @@ static DIR_info *read_cache_dir(
{
free(dirstruct->dir_name);
free(dirstruct);
dprintf(("","read_cache_dir: imagew failes:1\n"));
dprintf(("","read_cache_dir: imager fails:1\n"));
return (DIR_info *)-1;
}
}
......@@ -1438,7 +1438,7 @@ static DIR_info *read_cache_dir(
{
free(dirstruct->dir_name);
free(dirstruct);
dprintf(("","read_cache_dir: imagew failes:2\n"));
dprintf(("","read_cache_dir: imager fails:2\n"));
return (DIR_info *)-1;
}
}
......@@ -1449,15 +1449,15 @@ static DIR_info *read_cache_dir(
{
free(dirstruct->dir_name);
free(dirstruct);
dprintf(("","read_cache_dir: imagew failes:3\n"));
dprintf(("","read_cache_dir: imager fails:3\n"));
return (DIR_info *)-1;
}
}
// NULL the lfn pointer store
int i;
for(i=0;i<((dirstruct->dir_size)/sizeof(DOS_direntry));i++) dirstruct->lfnp[i] = NULL;
dprintf(("","read_cache_dir: last nulled %p \n", &dirstruct->lfnp[i-1]));
dprintf(("","read_cache_dir: last lfnp NULLed:%p \n", &dirstruct->lfnp[i-1]));
//CBC: Get long file names where appropriate
DOS_direntry * fentry = (DOS_direntry*)(DI_Base(dirstruct));
......@@ -1476,13 +1476,18 @@ static DIR_info *read_cache_dir(
lfnnum=1;
dprintf(("","_read lfns: lfn entry\n"));
while(lfnentry->FILE_attribute == 0xF &&
lfnentry->FILE_checksum == lfnchecksum((char*)&((fentry+i)->FILE_status)) &&
(lfnentry->FILE_Ordinal & 0x40) != 0x40)//Not last in chain
{
dprintf(("","_read lfns: extended lfn"));
lfnentry--;
lfnnum++;
}
if(lfnentry->FILE_checksum != lfnchecksum((char*)&((fentry+i)->FILE_status)))
{
dprintf(("","_read lfns: extended lfn but no cksum match"));
break;
}
dirstruct->lfnp[i] = calloc( ((((int)(fentry+i)-(int)lfnentry)/sizeof(DOS_direntry)) * 13)+1, sizeof(char));
dprintf(("","_read lfns: Creating a long filename buffer: size = %d, address = %p\n",(((int)(fentry+i)-(int)lfnentry)/sizeof(DOS_direntry))*13,dirstruct->lfnp[i]));
dprintf(("","_read lfns: Index = %d, Address = %p\n",i,&(dirstruct->lfnp[i])));
......@@ -1519,13 +1524,6 @@ static DIR_info *read_cache_dir(
*offset=lfnentry->FILE_uchar12;
offset++;
}
}else
{
if(i<((dirstruct->dir_size)/sizeof(DOS_direntry))-1)
{
dirstruct->lfnp[i+1] = NULL;
dprintf(("","read_cache_dir: %x nulling %p \n", (dirstruct->dir_size)/sizeof(DOS_direntry),&dirstruct->lfnp[i+1]));
}
}
i++;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment