diff options
author | Christopher Faylor <me@cgf.cx> | 2001-12-03 20:09:33 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2001-12-03 20:09:33 +0000 |
commit | 7543995b74deea91ce4d3f793f240c2d0c6c1b1f (patch) | |
tree | a0bef4b7742140b9ae4a3768fb88bca020586965 /winsup/cygwin/path.cc | |
parent | 6dfcb5a3a9bb858d36c9ab0545ac5ea8726897ba (diff) | |
download | newlib-7543995b74deea91ce4d3f793f240c2d0c6c1b1f.zip newlib-7543995b74deea91ce4d3f793f240c2d0c6c1b1f.tar.gz newlib-7543995b74deea91ce4d3f793f240c2d0c6c1b1f.tar.bz2 |
* net.cc (cygwin_getsockopt): Allow NULL optval.
* path.cc (mount_info::read_cygdrive_info_from_registry): Don't write cygdrive
to registry if it doesn't exist.
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r-- | winsup/cygwin/path.cc | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 4c295f2..4938b46 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -1867,8 +1867,7 @@ mount_info::read_cygdrive_info_from_registry () /* reg_key for user path prefix in HKEY_CURRENT_USER. */ reg_key r; - if (r.get_string (CYGWIN_INFO_CYGDRIVE_PREFIX, cygdrive, sizeof (cygdrive), - "") != 0) + if (r.get_string (CYGWIN_INFO_CYGDRIVE_PREFIX, cygdrive, sizeof (cygdrive), "") != 0) { /* Didn't find the user path prefix so check the system path prefix. */ @@ -1878,22 +1877,12 @@ mount_info::read_cygdrive_info_from_registry () CYGWIN_INFO_CYGWIN_MOUNT_REGISTRY_NAME, NULL); - if (r2.get_string (CYGWIN_INFO_CYGDRIVE_PREFIX, cygdrive, sizeof (cygdrive), - "") != 0) - { - /* Didn't find either so write the default to the registry and use it. - NOTE: We are writing and using the user path prefix. */ - write_cygdrive_info_to_registry (CYGWIN_INFO_CYGDRIVE_DEFAULT_PREFIX, - MOUNT_AUTO); - } - else - { - /* Fetch system cygdrive_flags from registry; returns MOUNT_AUTO on - error. */ - cygdrive_flags = r2.get_int (CYGWIN_INFO_CYGDRIVE_FLAGS, MOUNT_AUTO); - slashify (cygdrive, cygdrive, 1); - cygdrive_len = strlen(cygdrive); - } + if (r2.get_string (CYGWIN_INFO_CYGDRIVE_PREFIX, cygdrive, + sizeof (cygdrive), "")) + strcpy (cygdrive, CYGWIN_INFO_CYGDRIVE_DEFAULT_PREFIX); + cygdrive_flags = r2.get_int (CYGWIN_INFO_CYGDRIVE_FLAGS, MOUNT_AUTO); + slashify (cygdrive, cygdrive, 1); + cygdrive_len = strlen (cygdrive); } else { |