diff options
author | Pierre Humblet <phumblet@phumblet.no-ip.org> | 2004-12-03 02:00:37 +0000 |
---|---|---|
committer | Pierre Humblet <phumblet@phumblet.no-ip.org> | 2004-12-03 02:00:37 +0000 |
commit | 8151e674bafcd9a4a54caa1cba6685737354cc6b (patch) | |
tree | b2e00e4b4bfbb14c8c1240dbb85d041bd0604a50 /winsup/cygwin/environ.cc | |
parent | 3263f819aa5e0d90a9a7203b3c98156bb4012229 (diff) | |
download | cygnal-8151e674bafcd9a4a54caa1cba6685737354cc6b.tar.gz cygnal-8151e674bafcd9a4a54caa1cba6685737354cc6b.tar.bz2 cygnal-8151e674bafcd9a4a54caa1cba6685737354cc6b.zip |
2004-12-03 Pierre Humblet <pierre.humblet@ieee.org>
* registry.h (reg_key::reg_key): Change arguments.
* shared_info.h (class mount_info): Remove had_to_create_mount_areas.
* registry.cc (reg_key::reg_key): Change constructors to always handle
HKLM and to avoid relying on HKCU.
Do not set mount_table->had_to_create_mount_areas.
* path.cc (mount_info::conv_to_win32_path): Improve update of
sys_mount_table_counter.
(mount_info::read_mounts): Use new reg_key constructor.
(mount_info::add_reg_mount): Ditto.
(mount_info::del_reg_mount): Ditto.
(mount_info::read_cygdrive_info_from_registry): Ditto.
(mount_info::write_cygdrive_info_to_registry): Ditto.
Update cygwin_shared->sys_mount_table_counter after registry update.
(mount_info::get_cygdrive_info): Ditto.
* shared.cc (shared_info::heap_chunk_size): Use new reg_key constructor.
* environ.cc (regopt): Ditto.
Diffstat (limited to 'winsup/cygwin/environ.cc')
-rw-r--r-- | winsup/cygwin/environ.cc | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc index 4881592d9..dc5079e12 100644 --- a/winsup/cygwin/environ.cc +++ b/winsup/cygwin/environ.cc @@ -640,29 +640,22 @@ static bool __stdcall regopt (const char *name) { bool parsed_something = false; - /* FIXME: should not be under mount */ - reg_key r (KEY_READ, CYGWIN_INFO_PROGRAM_OPTIONS_NAME, NULL); char buf[CYG_MAX_PATH]; char lname[strlen (name) + 1]; strlwr (strcpy (lname, name)); - if (r.get_string (lname, buf, sizeof (buf) - 1, "") == ERROR_SUCCESS) + for (int i = 0; i < 2; i++) { - parse_options (buf); - parsed_something = true; - } - else - { - reg_key r1 (HKEY_LOCAL_MACHINE, KEY_READ, "SOFTWARE", - CYGWIN_INFO_CYGNUS_REGISTRY_NAME, - CYGWIN_INFO_CYGWIN_REGISTRY_NAME, - CYGWIN_INFO_PROGRAM_OPTIONS_NAME, NULL); - if (r1.get_string (lname, buf, sizeof (buf) - 1, "") == ERROR_SUCCESS) + reg_key r (i, KEY_READ, CYGWIN_INFO_PROGRAM_OPTIONS_NAME, NULL); + + if (r.get_string (lname, buf, sizeof (buf) - 1, "") == ERROR_SUCCESS) { parse_options (buf); parsed_something = true; + break; } } + MALLOC_CHECK; return parsed_something; } |