* path.cc (path_conv::update_fs_info): Don't consider remote drives to be NTFS.

Set root_dir before invoking GetDriveType (from Kazuhiro Fujieda
<fujieda@jaist.ac.jp>).  Eliminate extra checks for rootdir.
This commit is contained in:
Christopher Faylor 2001-06-11 03:38:32 +00:00
parent 02782489a9
commit fc633b63a2
2 changed files with 22 additions and 18 deletions

View File

@ -1,3 +1,9 @@
Sun Jun 10 23:34:09 2001 Christopher Faylor <cgf@cygnus.com>
* path.cc (path_conv::update_fs_info): Don't consider remote drives to
be NTFS. Set root_dir before invoking GetDriveType (from Kazuhiro
Fujieda <fujieda@jaist.ac.jp>). Eliminate extra checks for rootdir.
Sun Jun 10 20:19:47 2001 Christopher Faylor <cgf@cygnus.com>
* path.cc (chdir): Pre-check path for validity before eating trailing

View File

@ -312,9 +312,7 @@ path_conv::update_fs_info (const char* win32_path)
char tmp_buf [MAX_PATH];
strncpy (tmp_buf, win32_path, MAX_PATH);
if (!rootdir (tmp_buf) &&
(!GetCurrentDirectory (sizeof (tmp_buf), tmp_buf) <= sizeof (tmp_buf) ||
!rootdir (tmp_buf)))
if (!rootdir (tmp_buf))
{
debug_printf ("Cannot get root component of path %s", win32_path);
root_dir [0] = fs_name [0] = '\0';
@ -325,13 +323,13 @@ path_conv::update_fs_info (const char* win32_path)
if (strcmp (tmp_buf, root_dir) != 0)
{
strncpy (root_dir, tmp_buf, MAX_PATH);
drive_type = GetDriveType (root_dir);
if (drive_type == DRIVE_REMOTE || (drive_type == DRIVE_UNKNOWN && (root_dir[0] == '\\' && root_dir[1] == '\\')))
is_remote_drive = 1;
else
is_remote_drive = 0;
strncpy (root_dir, tmp_buf, MAX_PATH);
if (!GetVolumeInformation (root_dir, NULL, 0, &fs_serial, NULL, &fs_flags,
fs_name, sizeof (fs_name)))
{
@ -347,7 +345,7 @@ path_conv::update_fs_info (const char* win32_path)
* distinguish between samba and real ntfs, it should be implemented
* here.
*/
sym_opt = (strcmp (fs_name, "NTFS") == 0 ? PC_CHECK_EA : 0);
sym_opt = (!is_remote_drive && strcmp (fs_name, "NTFS") == 0) ? PC_CHECK_EA : 0;
}
}
}