kolibrios-gitea/programs/cmm/eolite/include/fs.h
Kirill Lipatov (Leency) e1c7133e38 Eolite 3.91:
1. fixed a critical issue in setElementSelectedFlag() function which could cause app crash after paste several elements
2. also deny copying in several cases (empty disk, ".." element)
3. fix regression: icon for a file without extension, not executable

git-svn-id: svn://kolibrios.org@7278 a494cfbc-eb01-0410-851d-a64ba20cac60
2018-05-13 16:06:20 +00:00

35 lines
739 B
C

BDVK file_info_count;
int file_count_copy;
void DirFileCount(dword way)
{
dword dirbuf, fcount, i, filename;
dword cur_file;
if (dir_exists(way))
{
cur_file = malloc(4096);
// In the process of recursive descent, memory must be allocated
// dynamically, because the static variable cause a fault!!!
// But unfortunately pass away to sacrifice speed.
GetDir(#dirbuf, #fcount, way, DIRS_ONLYREAL);
filename = dirbuf+72;
for (i=0; i<fcount; i++)
{
filename += 304;
sprintf(cur_file,"%s/%s",way,filename);
if (TestBit(ESDWORD[filename-40], 4) )
{
file_count_copy++;
DirFileCount(cur_file);
}
else
{
file_count_copy++;
}
}
free(cur_file);
}
}