Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion dirDiffPatch/dir_diff/dir_diff_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,39 @@ hpatch_BOOL hdiff_dirNext(hdiff_TDirHandle dirHandle,hpatch_TPathType *out_type,
*out_subName_utf8=0; //finish
return hpatch_TRUE;
}


#ifdef __QNX__
static char fullName_utf8[hpatch_kPathMaxSize];
static char subName_utf8[hpatch_kPathMaxSize];
strncpy(subName_utf8, pdirent->d_name, hpatch_kPathMaxSize - 1);
subName_utf8[hpatch_kPathMaxSize - 1] = '\0';
*out_subName_utf8 = subName_utf8;
while(pdirent = readdir(pdir))
{
if (strcmp(pdirent->d_name, ".") == 0 || strcmp(pdirent->d_name, "..") == 0)
{
continue;
}
snprintf(fullName_utf8, hpatch_kPathMaxSize, "%s/%s", subName_utf8, pdirent->d_name);
struct stat sb;
if (stat(fullName_utf8, &sb) == 0)
{
if (S_ISDIR(sb.st_mode))
{
*out_type = kPathType_dir;
*out_subName_utf8 = fullName_utf8;
}
else
{
*out_type = kPathType_file;
*out_subName_utf8 = fullName_utf8;
}
return hpatch_TRUE;
}
}
*out_subName_utf8 = 0;
return hpatch_TRUE;
#else
if (pdirent->d_type==DT_DIR){
*out_type=kPathType_dir;
*out_subName_utf8=pdirent->d_name;
Expand All @@ -130,6 +162,7 @@ hpatch_BOOL hdiff_dirNext(hdiff_TDirHandle dirHandle,hpatch_TPathType *out_type,
}else{
return hdiff_dirNext(dirHandle,out_type,out_subName_utf8);
}
#endif
}

void hdiff_dirClose(hdiff_TDirHandle dirHandle){
Expand Down