diff --git a/src/namspace.c b/src/namspace.c index 6a2832e..6f6e5c7 100644 --- a/src/namspace.c +++ b/src/namspace.c @@ -1494,9 +1494,17 @@ static int search_match(struct dirent *dirbuff, if (!inode_search) { if (namespace == NAME_DOS) { if (*name != '.') { + uint8 dosalias[14]; build_dos_83_alias(vol_options, ds->unixname, name, - dirbuff->d_ino, dname, size_dname); - flag = fn_dos_match_old(dname, entry, vol_options); + dirbuff->d_ino, dosalias, sizeof(dosalias)); + flag = fn_dos_match_old(dosalias, entry, vol_options); + /* + * Keep dname as the real on-disk name. get_add_new_entry() + * appends dname to the parent and stats it; passing the synthetic + * DOS alias here makes long-name matches fail with + * "nw_search_file_dir:Cannot add entry". The alias is only for + * matching and for the returned INFO_MSK_ENTRY_NAME. + */ } } else if (namespace == NAME_OS2) { flag = (*name != '.' || (*(name+1) != '.' && *(name+1) != '\0' ))