- if (dentry_add_child(dentry, child)) {
- WARNING("Ignoring duplicate dentry \"%"WS"\"",
- child->file_name);
- WARNING("(In directory \"%"TS"\")", dentry_full_path(dentry));
+ duplicate = dentry_add_child(dentry, child);
+ if (duplicate) {
+ const tchar *child_type, *duplicate_type;
+ child_type = dentry_get_file_type_string(child);
+ duplicate_type = dentry_get_file_type_string(duplicate);
+ /* On UNIX, duplicates are exact. On Windows,
+ * duplicates may differ by case and we wish to provide
+ * a different warning message in this case. */
+ #ifdef __WIN32__
+ if (dentry_compare_names_case_sensitive(child, duplicate))
+ {
+ child->parent = dentry;
+ WARNING("Ignoring %ls \"%ls\", which differs "
+ "only in case from %ls \"%ls\"",
+ child_type,
+ dentry_full_path(child),
+ duplicate_type,
+ dentry_full_path(duplicate));
+ }
+ else
+ #endif
+ {
+ WARNING("Ignoring duplicate %"TS" \"%"TS"\" "
+ "(the WIM image already contains a %"TS" "
+ "at that path with the exact same name)",
+ child_type, dentry_full_path(duplicate),
+ duplicate_type);
+ }