Skip to content

Commit

Permalink
crnlib: don't stop listing files if there is an unknown file type in …
Browse files Browse the repository at this point in the history
…a directory, skip it

Co-authored-by: DolceTriade <[email protected]>
  • Loading branch information
illwieckz and DolceTriade committed Oct 8, 2024
1 parent 0e2e553 commit 573d3ff
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions crnlib/crn_find_files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,18 +233,14 @@ bool find_files::find_internal(const char* pBasepath, const char* pRelpath, cons
}
}

if (!known) {
console::error("Cannot detect if the given path is a file or a directory");
return false;
}
dynamic_string filename(ep->d_name);
dynamic_string fullname = pathname + filename;

if (!is_file && !is_directory) {
console::error("The given path is not a file neither a directory");
return false;
if (!known || (!is_file && !is_directory)) {
console::warning("Ignoring unsupported path: %s", fullname.get_ptr());
continue;
}

dynamic_string filename(ep->d_name);

if (is_directory) {
if (flags & cFlagRecursive) {
paths.push_back(filename);
Expand All @@ -259,7 +255,7 @@ bool find_files::find_internal(const char* pBasepath, const char* pRelpath, cons
file.m_base = pBasepath;
file.m_rel = pRelpath;
file.m_name = filename;
file.m_fullname = pathname + filename;
file.m_fullname = fullname;
}
}
}
Expand Down

0 comments on commit 573d3ff

Please sign in to comment.