Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2006-03-02 12:48:42 +0300
committerCorinna Vinschen <corinna@vinschen.de>2006-03-02 12:48:42 +0300
commit471573dc77a630841ab3b48eca0b22117251dcd2 (patch)
treea1bed49ccb247c0984979c46c69bf27dc91bb6cb
parentd2493dc9650620801d7daf4cc9da2d5f5dfb515d (diff)
* fhandler_disk_file.cc (__DIR_mounts::check_missing_mount): Check
cygdrive string length for those who have cygdrive mapped to "/".
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/fhandler_disk_file.cc11
2 files changed, 12 insertions, 4 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index eaf2dce98..8c2e24ded 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2006-03-02 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler_disk_file.cc (__DIR_mounts::check_missing_mount): Check
+ cygdrive string length for those who have cygdrive mapped to "/".
+
2006-03-01 Corinna Vinschen <corinna@vinschen.de>
* sec_helper.cc (set_cygwin_privileges): Request SE_BACKUP_NAME
diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc
index 84234c4a3..dc46cbcef 100644
--- a/winsup/cygwin/fhandler_disk_file.cc
+++ b/winsup/cygwin/fhandler_disk_file.cc
@@ -114,10 +114,13 @@ public:
if (!found[__DIR_CYGDRIVE])
{
found[__DIR_CYGDRIVE] = true;
- strncpy (ret_name, mount_table->cygdrive + 1,
- mount_table->cygdrive_len - 2);
- ret_name[mount_table->cygdrive_len - 2] = '\0';
- return 2;
+ if (mount_table->cygdrive_len > 1)
+ {
+ strncpy (ret_name, mount_table->cygdrive + 1,
+ mount_table->cygdrive_len - 2);
+ ret_name[mount_table->cygdrive_len - 2] = '\0';
+ return 2;
+ }
}
}
return 0;