mirror of https://github.com/FDOS/kernel.git
"rmdir" and FAT32 fixes from Tom.
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@499 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
parent
43bee4de3a
commit
b43f271014
|
@ -97,7 +97,6 @@ static BYTE *fat_hRcsId =
|
|||
*/
|
||||
#define _ISFAT32(dpbp) (((dpbp)->dpb_fatsize)==0)
|
||||
#define ISFAT16(dpbp) (((dpbp)->dpb_size)>FAT_MAGIC && ((dpbp)->dpb_size)<=FAT_MAGIC16 )
|
||||
#define ELSE_ISFAT16(dpbp) (((dpbp)->dpb_size)<=FAT_MAGIC16 )
|
||||
#define ISFAT12(dpbp) ((((dpbp)->dpb_size)-1)<FAT_MAGIC)
|
||||
/* dpb_size == 0 for FAT32, hence doing -1 here */
|
||||
|
||||
|
|
|
@ -261,3 +261,4 @@ typedef VOID (FAR ASMCFUNC * intvec) (void);
|
|||
#define PROTO
|
||||
#endif
|
||||
|
||||
#define LENGTH(x) (sizeof(x)/sizeof(x[0]))
|
||||
|
|
|
@ -618,6 +618,12 @@ COUNT dos_rmdir(BYTE * path)
|
|||
/* "." and ".." are permissable. */
|
||||
fnp->f_flags.f_dmod = FALSE;
|
||||
fnp1 = dir_open(path);
|
||||
if (fnp1 == NULL)
|
||||
{
|
||||
dir_close(fnp);
|
||||
return DE_ACCESS;
|
||||
}
|
||||
|
||||
dir_read(fnp1);
|
||||
if (fnp1->f_dir.dir_name[0] != '.')
|
||||
{
|
||||
|
|
|
@ -192,7 +192,7 @@ unsigned link_fat(struct dpb FAR * dpbp, CLUSTER Cluster1,
|
|||
*fbp1 = (*fbp1 & 0xf0) | ((Cluster2 >> 8) & 0x0f);
|
||||
}
|
||||
}
|
||||
else if (ELSE_ISFAT16(dpbp))
|
||||
else if (ISFAT16(dpbp))
|
||||
{
|
||||
/* form an index so that we can read the block as a */
|
||||
/* byte array */
|
||||
|
@ -328,7 +328,7 @@ CLUSTER next_cluster(struct dpb FAR * dpbp, CLUSTER ClusterNum)
|
|||
return LONG_BAD;
|
||||
return idx;
|
||||
}
|
||||
else if (ELSE_ISFAT16(dpbp))
|
||||
else if (ISFAT16(dpbp))
|
||||
{
|
||||
UWORD res;
|
||||
|
||||
|
|
Loading…
Reference in New Issue