diff options
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 13 | ||||
-rw-r--r-- | winsup/cygwin/include/cygwin/version.h | 3 | ||||
-rw-r--r-- | winsup/cygwin/path.cc | 25 |
3 files changed, 30 insertions, 11 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index d4a03c7..69cc0a5 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,16 @@ +Mon Nov 6 11:11:42 2000 Jason Tishler <jt@dothill.com> + + * path.cc (mount_info::read_cygdrive_info_from_registry): Use + CYGWIN_INFO_CYGDRIVE_PREFIX, CYGWIN_INFO_CYGDRIVE_DEFAULT_PREFIX, and + CYGWIN_INFO_CYGDRIVE_FLAGS. + * path.cc (mount_info::write_cygdrive_info_to_registry): Use + CYGWIN_INFO_CYGDRIVE_PREFIX and CYGWIN_INFO_CYGDRIVE_FLAGS. + * path.cc (mount_info::remove_cygdrive_info_from_registry): Ditto. + * path.cc (mount_info::get_cygdrive_prefixes): Use + CYGWIN_INFO_CYGDRIVE_PREFIX. + * include/cygwin/version.h: Add CYGWIN_INFO_CYGDRIVE_FLAGS, + CYGWIN_INFO_CYGDRIVE_PREFIX, and CYGWIN_INFO_CYGDRIVE_DEFAULT_PREFIX. + Mon Nov 6 11:10:44 2000 Jason Tishler <jt@dothill.com> * errno.cc (strerror): Change EAGAIN case to return "Resource diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h index 08f2261..1ded09d 100644 --- a/winsup/cygwin/include/cygwin/version.h +++ b/winsup/cygwin/include/cygwin/version.h @@ -156,6 +156,9 @@ details. */ #define CYGWIN_INFO_CYGWIN_REGISTRY_NAME "Cygwin" #define CYGWIN_INFO_PROGRAM_OPTIONS_NAME "Program Options" #define CYGWIN_INFO_CYGWIN_MOUNT_REGISTRY_NAME "mounts v2" +#define CYGWIN_INFO_CYGDRIVE_FLAGS "cygdrive flags" +#define CYGWIN_INFO_CYGDRIVE_PREFIX "cygdrive prefix" +#define CYGWIN_INFO_CYGDRIVE_DEFAULT_PREFIX "/cygdrive" /* In addition to the above version number strings, the build process adds some strings that may be useful in diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 8e7d586..94cfb5a 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -1502,7 +1502,8 @@ mount_info::read_cygdrive_info_from_registry () /* reg_key for user path prefix in HKEY_CURRENT_USER. */ reg_key r; - if (r.get_string ("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. */ @@ -1513,17 +1514,19 @@ mount_info::read_cygdrive_info_from_registry () CYGWIN_INFO_CYGWIN_MOUNT_REGISTRY_NAME, NULL); - if (r2.get_string ("cygdrive prefix", cygdrive, sizeof (cygdrive), "") != 0) + 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 ("/cygdrive", MOUNT_AUTO); + 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 ("cygdrive flags", MOUNT_AUTO); + cygdrive_flags = r2.get_int (CYGWIN_INFO_CYGDRIVE_FLAGS, MOUNT_AUTO); slashify (cygdrive, cygdrive, 1); cygdrive_len = strlen(cygdrive); } @@ -1532,7 +1535,7 @@ mount_info::read_cygdrive_info_from_registry () { /* Fetch user cygdrive_flags from registry; returns MOUNT_AUTO on error. */ - cygdrive_flags = r.get_int ("cygdrive flags", MOUNT_AUTO); + cygdrive_flags = r.get_int (CYGWIN_INFO_CYGDRIVE_FLAGS, MOUNT_AUTO); slashify (cygdrive, cygdrive, 1); cygdrive_len = strlen(cygdrive); } @@ -1571,13 +1574,13 @@ mount_info::write_cygdrive_info_to_registry (const char *cygdrive_prefix, unsign nofinalslash (cygdrive_prefix, hold_cygdrive_prefix); int res; - res = r.set_string ("cygdrive prefix", hold_cygdrive_prefix); + res = r.set_string (CYGWIN_INFO_CYGDRIVE_PREFIX, hold_cygdrive_prefix); if (res != ERROR_SUCCESS) { __seterrno_from_win_error (res); return -1; } - r.set_int ("cygdrive flags", flags); + r.set_int (CYGWIN_INFO_CYGDRIVE_FLAGS, flags); /* This also needs to go in the in-memory copy of "cygdrive", but only if appropriate: @@ -1609,8 +1612,8 @@ mount_info::remove_cygdrive_info_from_registry (const char *cygdrive_prefix, uns NULL); /* Delete cygdrive prefix and flags. */ - int res = r.killvalue ("cygdrive prefix"); - int res2 = r.killvalue ("cygdrive flags"); + int res = r.killvalue (CYGWIN_INFO_CYGDRIVE_PREFIX); + int res2 = r.killvalue (CYGWIN_INFO_CYGDRIVE_FLAGS); /* Reinitialize the cygdrive path prefix to reflect to removal from the registry. */ @@ -1624,7 +1627,7 @@ mount_info::get_cygdrive_prefixes (char *user, char *system) { /* Get the user path prefix from HKEY_CURRENT_USER. */ reg_key r; - int res = r.get_string ("cygdrive prefix", user, MAX_PATH, ""); + int res = r.get_string (CYGWIN_INFO_CYGDRIVE_PREFIX, user, MAX_PATH, ""); /* Get the system path prefix from HKEY_LOCAL_MACHINE. */ reg_key r2 (HKEY_LOCAL_MACHINE, KEY_ALL_ACCESS, "SOFTWARE", @@ -1632,7 +1635,7 @@ mount_info::get_cygdrive_prefixes (char *user, char *system) CYGWIN_INFO_CYGWIN_REGISTRY_NAME, CYGWIN_INFO_CYGWIN_MOUNT_REGISTRY_NAME, NULL); - int res2 = r2.get_string ("cygdrive prefix", system, MAX_PATH, ""); + int res2 = r2.get_string (CYGWIN_INFO_CYGDRIVE_PREFIX, system, MAX_PATH, ""); return (res != ERROR_SUCCESS) ? res : res2; } |