summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/path.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2000-11-08 20:36:37 +0000
committerChristopher Faylor <me@cgf.cx>2000-11-08 20:36:37 +0000
commit9bc846bd3d5fc13eb28b4ddece0ecfc52caf898a (patch)
tree2fd164536ce8697b5dc316629c913edf27dbdbeb /winsup/cygwin/path.cc
parent315f8fd37b75a6cfe589afb9eb18cc9bb59874ac (diff)
downloadcygnal-9bc846bd3d5fc13eb28b4ddece0ecfc52caf898a.tar.gz
cygnal-9bc846bd3d5fc13eb28b4ddece0ecfc52caf898a.tar.bz2
cygnal-9bc846bd3d5fc13eb28b4ddece0ecfc52caf898a.zip
* environ.cc (_addenv): malloc space for setenv if cygwin1.dll is used in
conjunction with older binaries. (environ_init): Ditto. * external.cc (get_cygdrive_info): New function. * external.cc (get_cygdrive_prefixes): Change to use get_cygdrive_info but toss the user and system flags. * external.cc (cygwin_internal): Add new CW_GET_CYGDRIVE_INFO case. * path.cc (mount_info::get_cygdrive_prefixes): Remove method. * path.cc (mount_info::get_cygdrive_info): New method. Actually, get_cygdrive_info is really an enhanced version of get_cygdrive_prefixes renamed to get_cygdrive_info that also gets the user and system flags. * shared_info.h (get_cygdrive_prefixes): Remove method. * shared_info.h (get_cygdrive_info): New method. * include/cygwin/version.h: Bump minor API version due to adding CW_GET_CYGDRIVE_INFO to cygwin_internal. * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_GET_CYGDRIVE_INFO.
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r--winsup/cygwin/path.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 94cfb5a9d..34a2b983b 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -1623,12 +1623,20 @@ mount_info::remove_cygdrive_info_from_registry (const char *cygdrive_prefix, uns
}
int
-mount_info::get_cygdrive_prefixes (char *user, char *system)
+mount_info::get_cygdrive_info (char *user, char *system, char* user_flags,
+ char* system_flags)
{
/* Get the user path prefix from HKEY_CURRENT_USER. */
reg_key r;
int res = r.get_string (CYGWIN_INFO_CYGDRIVE_PREFIX, user, MAX_PATH, "");
+ /* Get the user flags, if appropriate */
+ if (res == ERROR_SUCCESS)
+ {
+ int flags = r.get_int (CYGWIN_INFO_CYGDRIVE_FLAGS, MOUNT_AUTO);
+ strcpy (user_flags, (flags & MOUNT_BINARY) ? "binmode" : "textmode");
+ }
+
/* Get the system path prefix from HKEY_LOCAL_MACHINE. */
reg_key r2 (HKEY_LOCAL_MACHINE, KEY_ALL_ACCESS, "SOFTWARE",
CYGWIN_INFO_CYGNUS_REGISTRY_NAME,
@@ -1637,6 +1645,13 @@ mount_info::get_cygdrive_prefixes (char *user, char *system)
NULL);
int res2 = r2.get_string (CYGWIN_INFO_CYGDRIVE_PREFIX, system, MAX_PATH, "");
+ /* Get the system flags, if appropriate */
+ if (res2 == ERROR_SUCCESS)
+ {
+ int flags = r2.get_int (CYGWIN_INFO_CYGDRIVE_FLAGS, MOUNT_AUTO);
+ strcpy (system_flags, (flags & MOUNT_BINARY) ? "binmode" : "textmode");
+ }
+
return (res != ERROR_SUCCESS) ? res : res2;
}