next dos83 fixes
All checks were successful
Source release / source-package (push) Successful in 58s

This commit is contained in:
Mario Fetka
2026-05-20 07:54:51 +02:00
parent cec052e5b3
commit 8fc9c9e8e6

View File

@@ -596,27 +596,41 @@ static int func_search_entry(NW_PATH *nwpath, int attrib,
while ((dirbuff = readdir(f)) != (struct dirent*)NULL){
okflag = 0;
if (dirbuff->d_ino) {
uint8 *name=(uint8*)(dirbuff->d_name);
uint8 dname[256];
xstrcpy(dname, name);
unix2doscharset(dname);
okflag = (name[0] != '.' &&
( (!strcmp((char*)dname, (char*)entry))
|| fn_dos_match(dname, entry, soptions)));
uint8 *name = (uint8 *)(dirbuff->d_name);
uint8 dosname[DOS83_NAME_MAX + 1];
okflag = 0;
if (name[0] != '.') {
okflag = dos83_match_name_in_dir(xkpath,
name,
entry,
soptions,
dosname,
sizeof(dosname));
}
if (okflag) {
*kpath = '\0';
strmaxcpy(kpath, (char*)name, sizeof(xkpath) - (int)(kpath-xkpath) -1 );
strmaxcpy(kpath, (char *)name, sizeof(xkpath) - (int)(kpath - xkpath) - 1);
if (!s_stat(xkpath, &(fs->statb), NULL)) {
okflag = ( ( ( (fs->statb.st_mode & S_IFMT) == S_IFDIR) && (attrib & 0x10))
|| ( ( (fs->statb.st_mode & S_IFMT) != S_IFDIR) && !(attrib & 0x10)));
if (okflag){
xstrcpy(nwpath->fn, (char*)dname);
XDPRINTF((5,0,"FOUND=:%s: attrib=0x%x", nwpath->fn, fs->statb.st_mode));
okflag = ((((fs->statb.st_mode & S_IFMT) == S_IFDIR) && (attrib & 0x10))
|| (((fs->statb.st_mode & S_IFMT) != S_IFDIR) && !(attrib & 0x10)));
if (okflag) {
/* Return the DOS-visible alias instead of the raw long name. */
xstrcpy(nwpath->fn, (char *)dosname);
XDPRINTF((5,0,"FOUND DOS alias=:%s: attrib=0x%x", nwpath->fn, fs->statb.st_mode));
result = (*fs_func)(nwpath, fs);
if (result < 0) break;
else result=1;
if (result < 0)
break;
else
result = 1;
}
} else okflag = 0;
} else {
okflag = 0;
}
}
XDPRINTF((6,0, "NAME=:%s: OKFLAG %d", name, okflag));
} /* if */
@@ -677,29 +691,37 @@ static int get_dir_entry(NW_PATH *nwpath,
okflag = -0xff;
(*sequence)++;
if (dirbuff->d_ino) {
uint8 *name=(uint8*)(dirbuff->d_name);
uint8 dname[256];
xstrcpy(dname, name);
unix2doscharset(dname);
okflag = ((name[0] != '.' &&
( (!strcmp((char*)dname, (char*)entry))
|| fn_dos_match(dname, entry, soptions)))) ? 0 : -0xff;
uint8 *name = (uint8 *)(dirbuff->d_name);
uint8 dosname[DOS83_NAME_MAX + 1];
okflag = -0xff;
if (name[0] != '.') {
okflag = dos83_match_name_in_dir(xkpath,
name,
entry,
soptions,
dosname,
sizeof(dosname)) ? 0 : -0xff;
}
if (!okflag) {
*kpath = '\0';
strmaxcpy(kpath, (char*)name, sizeof(xkpath) - (int)(kpath-xkpath) -1);
strmaxcpy(kpath, (char *)name, sizeof(xkpath) - (int)(kpath - xkpath) - 1);
if (!s_stat(xkpath, statb, NULL)) {
okflag = (( ( ( (statb->st_mode & S_IFMT) == S_IFDIR) && (attrib & 0x10))
|| ( ( (statb->st_mode & S_IFMT) != S_IFDIR) && !(attrib & 0x10))))
okflag = ((((statb->st_mode & S_IFMT) == S_IFDIR) && (attrib & 0x10))
|| (((statb->st_mode & S_IFMT) != S_IFDIR) && !(attrib & 0x10)))
? 0 : -0xff;
if (!okflag){
if ( (!no_search_trustee) ||
if ((!no_search_trustee) ||
!tru_eff_rights_exists(volume, xkpath, statb, TRUSTEE_T)) {
if (soptions & VOL_OPTION_IS_PIPE) {
statb->st_size = 0x70000000|(statb->st_mtime&0xfffffff);
statb->st_size = 0x70000000 | (statb->st_mtime & 0xfffffff);
}
xstrcpy(nwpath->fn, (char*)dname);
XDPRINTF((5,0,"FOUND=:%s: attrib=0x%x", nwpath->fn, statb->st_mode));
/* Return the generated DOS-visible short name. */
xstrcpy(nwpath->fn, (char *)dosname);
XDPRINTF((5,0,"FOUND DOS alias=:%s: attrib=0x%x", nwpath->fn, statb->st_mode));
break; /* ready */
} else
okflag = -0xff;