mirror of
https://github.com/akuker/RASCSI.git
synced 2024-11-26 13:49:21 +00:00
Link to directory is not a valid image file (#292)
This commit is contained in:
parent
c581c12d33
commit
6d32a8d102
@ -142,7 +142,7 @@ bool ProtobufResponseHandler::GetImageFile(PbImageFile *image_file, const string
|
||||
image_file->set_read_only(access(f.c_str(), W_OK));
|
||||
|
||||
struct stat st;
|
||||
if (!stat(f.c_str(), &st)) {
|
||||
if (!stat(f.c_str(), &st) && !S_ISDIR(st.st_mode)) {
|
||||
image_file->set_size(st.st_size);
|
||||
return true;
|
||||
}
|
||||
@ -181,8 +181,12 @@ PbImageFilesInfo *ProtobufResponseHandler::GetAvailableImages(PbResult& result,
|
||||
continue;
|
||||
}
|
||||
|
||||
PbImageFile *image_file = new PbImageFile();
|
||||
if (GetImageFile(image_file, dir->d_name, image_folder)) {
|
||||
GetImageFile(image_files_info->add_image_files(), dir->d_name, image_folder);
|
||||
}
|
||||
delete image_file;
|
||||
}
|
||||
}
|
||||
|
||||
closedir(d);
|
||||
|
Loading…
Reference in New Issue
Block a user