Skip to content

Commit 573d3ff

Browse files
crnlib: don't stop listing files if there is an unknown file type in a directory, skip it
Co-authored-by: DolceTriade <vcelestialragev@gmail.com>
1 parent 0e2e553 commit 573d3ff

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

crnlib/crn_find_files.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -233,18 +233,14 @@ bool find_files::find_internal(const char* pBasepath, const char* pRelpath, cons
233233
}
234234
}
235235

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

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

246-
dynamic_string filename(ep->d_name);
247-
248244
if (is_directory) {
249245
if (flags & cFlagRecursive) {
250246
paths.push_back(filename);
@@ -259,7 +255,7 @@ bool find_files::find_internal(const char* pBasepath, const char* pRelpath, cons
259255
file.m_base = pBasepath;
260256
file.m_rel = pRelpath;
261257
file.m_name = filename;
262-
file.m_fullname = pathname + filename;
258+
file.m_fullname = fullname;
263259
}
264260
}
265261
}

0 commit comments

Comments
 (0)