Skip to content

Commit a0f9e57

Browse files
authored
Merge pull request #994 from Unity-Technologies/unity-master-fix-set-attributes
Fix SetAttribute not respecting file mappings FB1061522
2 parents f1bbc92 + f3b4079 commit a0f9e57

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

mono/metadata/w32file.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,13 +481,21 @@ ves_icall_System_IO_MonoIO_SetFileAttributes (const gunichar2 *path, gint32 attr
481481
gint32 *error)
482482
{
483483
gboolean ret;
484+
const gunichar2 *path_remapped;
485+
486+
if (path_remapped = mono_unity_remap_path_utf16 (path))
487+
path = path_remapped;
488+
484489
*error=ERROR_SUCCESS;
485490

486491
ret=mono_w32file_set_attributes (path,
487492
convert_attrs ((MonoFileAttributes)attrs));
488493
if(ret==FALSE) {
489494
*error=mono_w32error_get_last ();
490495
}
496+
497+
g_free (path_remapped);
498+
491499
return(ret);
492500
}
493501

0 commit comments

Comments
 (0)