* fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Don't
copy filename twice in the non-managed case.
This commit is contained in:
		| @@ -1,3 +1,8 @@ | |||||||
|  | 2008-03-12  Corinna Vinschen  <corinna@vinschen.de> | ||||||
|  |  | ||||||
|  | 	* fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Don't | ||||||
|  | 	copy filename twice in the non-managed case. | ||||||
|  |  | ||||||
| 2008-03-12  Corinna Vinschen  <corinna@vinschen.de> | 2008-03-12  Corinna Vinschen  <corinna@vinschen.de> | ||||||
|  |  | ||||||
| 	* winsup.h (NT_MAX_PATH): Revert ill-advised change to 32767. | 	* winsup.h (NT_MAX_PATH): Revert ill-advised change to 32767. | ||||||
|   | |||||||
| @@ -1785,16 +1785,20 @@ fhandler_disk_file::readdir_helper (DIR *dir, dirent *de, DWORD w32_err, | |||||||
| 	} | 	} | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   char tmp[NAME_MAX + 1]; |  | ||||||
|   sys_wcstombs (tmp, NAME_MAX + 1, fname->Buffer, |  | ||||||
|   		fname->Length / sizeof (WCHAR)); |  | ||||||
|   if (pc.isencoded ()) |   if (pc.isencoded ()) | ||||||
|     fnunmunge (de->d_name, tmp); |     { | ||||||
|  |       char tmp[NAME_MAX + 1]; | ||||||
|  |       sys_wcstombs (tmp, NAME_MAX + 1, fname->Buffer, | ||||||
|  | 		    fname->Length / sizeof (WCHAR)); | ||||||
|  |       fnunmunge (de->d_name, tmp); | ||||||
|  |     } | ||||||
|   else |   else | ||||||
|     strcpy (de->d_name, tmp); |     sys_wcstombs (de->d_name, NAME_MAX + 1, fname->Buffer, | ||||||
|   if (dir->__d_position == 0 && !strcmp (tmp, ".")) | 		  fname->Length / sizeof (WCHAR)); | ||||||
|  |  | ||||||
|  |   if (dir->__d_position == 0 && !strcmp (de->d_name, ".")) | ||||||
|     dir->__flags |= dirent_saw_dot; |     dir->__flags |= dirent_saw_dot; | ||||||
|   else if (dir->__d_position == 1 && !strcmp (tmp, "..")) |   else if (dir->__d_position == 1 && !strcmp (de->d_name, "..")) | ||||||
|     dir->__flags |= dirent_saw_dot_dot; |     dir->__flags |= dirent_saw_dot_dot; | ||||||
|   return 0; |   return 0; | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user