Commit 03c414ee authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Use a few defines, correct error text

Magic E5 and 0F's swapped for preexisting defines.
Name too long error (when truncate CMOS is off) erroneously said 8 characters was the name limit despite the loop counter check being 255 characters.
Not tagged.
parent 3da1b667
......@@ -163,11 +163,11 @@ static void packdir(DIR_info * cdir, DOS_direntry ** preserve)
DOS_direntry * dir = (DOS_direntry*)DI_Base(cdir);
for(ip=0,op=0;ip<ipend;ip++,op++)
{
// if( (dir+ip)->FILE_status == 0xE5)
// if( (dir+ip)->FILE_status == FILE_deleted)
// {//This is a deleted entry
// ip++;
while ( (ip<ipend)
&& ((dir+ip)->FILE_status == 0xE5)) ip++;
&& ((dir+ip)->FILE_status == FILE_deleted)) ip++;
// }else
if((dir+ip)->FILE_status == 0x00) ip=ipend;
// {//If there are no more dir entrys it is pointless to continue the loop
......@@ -179,7 +179,7 @@ static void packdir(DIR_info * cdir, DOS_direntry ** preserve)
if(preserve && ((dir+ip) == *preserve)) *preserve = (dir+op);
dprintf(("","packdir: ip = %d, op = %d\n",ip,op));
memmove(dir+op,dir+ip,sizeof(DOS_direntry));
(dir+ip)->FILE_status = 0xE5;
(dir+ip)->FILE_status = FILE_deleted;
cdir->lfnp[op] = cdir->lfnp[ip];
cdir->lfnp[ip] = NULL;
}
......@@ -678,8 +678,8 @@ static DIR_info *read_cache_dir(
{
if(((fentry+(i-1))->FILE_attribute == FILE_win95) &&
((fentry+i)->FILE_attribute != FILE_win95) && //Its file with a LFN entry before it
(fentry+i)->FILE_status != 0xE5 &&
(fentry+(i-1))->FILE_status != 0xE5 ) //And neither entrys are marked as deleted
(fentry+i)->FILE_status != FILE_deleted &&
(fentry+(i-1))->FILE_status != FILE_deleted ) //And neither entrys are marked as deleted
{
lfnentry = (DOS_lfnentry*)(fentry+(i-1));
lfnnum=1;
......@@ -700,10 +700,10 @@ static DIR_info *read_cache_dir(
j=i;
while(--j>=0)
{
if((fentry+j)->FILE_attribute==0xF)
if((fentry+j)->FILE_attribute==FILE_win95)
{
dprintf(("","_read lfns: Nullinf: %p \n",fentry+j));
(fentry+j)->FILE_status = 0xE5;
dprintf(("","_read lfns: Nulling: %p \n",fentry+j));
(fentry+j)->FILE_status = FILE_deleted;
}
else j=0;
}
......
......@@ -483,7 +483,7 @@ void MakeLFNEntries(DOS_direntry * lfn[],int numreq,char* leafname,char* shortna
lfnentry = (DOS_lfnentry*)lfn[i];
lfnentry->FILE_Ordinal = ((lfnnum&0x3F)+1);
if(i==0) lfnentry->FILE_Ordinal |= 0x40; // Last entry
lfnentry->FILE_attribute = 0x0F;
lfnentry->FILE_attribute = FILE_win95;
lfnentry->FILE_uchar0_hi = (nullreached)?0xFF:0;
lfnentry->FILE_uchar0 = (nullreached)?0xFF:leafname[charnum];
if(leafname[charnum]==NULL) nullreached=1;
......@@ -641,7 +641,7 @@ char *convertRISCOStoLFN(char *source,char *dest)
else
{
if (!(module_flags & TRUNCATE_NAMES))
return_errorT(char *, err_nametoolong, tok_nametoolong, source, namsizestr);
return_errorT(char *, err_nametoolong, tok_nametoolong, source, "255");
}
csptr++ ; /* step over this DOS character */
// }
......
......@@ -332,9 +332,9 @@ FS_cat_entry *DOSFS_delete(char *fname, DOSdisc *ihand)
free(cdir->lfnp[diroffset]);
cdir->lfnp[diroffset] = NULL;
DOS_lfnentry *lfndir = ((DOS_lfnentry*)dentry) - 1 ;
while(lfndir->FILE_attribute == 0xF)
while(lfndir->FILE_attribute == FILE_win95)
{
lfndir->FILE_Ordinal = 0xE5;
lfndir->FILE_Ordinal = FILE_deleted;
lfndir--;
if ((lfndir->FILE_Ordinal & 0x40) == 0) break;
}
......
......@@ -212,12 +212,12 @@ int DOSFS_rename(char *oldname,char *newname,DOSdisc *ihand)
cdir->lfnp[loop] = NULL;
}
found->FILE_status = 0xE5;
found->FILE_status = FILE_deleted;
found--;
while (((uintptr_t)found >= cdirp) && (found->FILE_attribute == FILE_win95))
{
dprintf(("","DOSFS_rename: cdirp = %x, nfound = %x\n",(int)cdirp,(int)found));
found->FILE_status = 0xE5;
found->FILE_status = FILE_deleted;
found--;
}
......
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