* mount.cc (mount_info::get_cygdrive_info): Fix usage of user and
system arguments. Strip trailing slash from path for backward compatibility.
This commit is contained in:
parent
d4ab21b1cc
commit
0730461203
|
@ -1,3 +1,9 @@
|
||||||
|
2008-06-12 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* mount.cc (mount_info::get_cygdrive_info): Fix usage of user and
|
||||||
|
system arguments. Strip trailing slash from path for backward
|
||||||
|
compatibility.
|
||||||
|
|
||||||
2008-06-12 Corinna Vinschen <corinna@vinschen.de>
|
2008-06-12 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* fhandler.h (set_console_state_for_spawn): Drop declaration.
|
* fhandler.h (set_console_state_for_spawn): Drop declaration.
|
||||||
|
|
|
@ -1032,17 +1032,25 @@ mount_info::get_cygdrive_info (char *user, char *system, char* user_flags,
|
||||||
{
|
{
|
||||||
if (user)
|
if (user)
|
||||||
*user = '\0';
|
*user = '\0';
|
||||||
/* Get the user flags, if appropriate */
|
if (system)
|
||||||
|
*system = '\0';
|
||||||
if (user_flags)
|
if (user_flags)
|
||||||
*user_flags = '\0';
|
*user_flags = '\0';
|
||||||
|
|
||||||
if (system)
|
|
||||||
strcpy (system, cygdrive);
|
|
||||||
|
|
||||||
if (system_flags)
|
if (system_flags)
|
||||||
strcpy (system_flags,
|
*system_flags = '\0';
|
||||||
(cygdrive_flags & MOUNT_BINARY) ? "binmode" : "textmode");
|
|
||||||
|
|
||||||
|
char *path = (cygdrive_flags & MOUNT_SYSTEM) ? system : user;
|
||||||
|
char *flags = (cygdrive_flags & MOUNT_SYSTEM) ? system_flags : user_flags;
|
||||||
|
|
||||||
|
if (path)
|
||||||
|
{
|
||||||
|
strcpy (path, cygdrive);
|
||||||
|
/* Strip trailing slash for backward compatibility. */
|
||||||
|
if (cygdrive_len > 2)
|
||||||
|
path[cygdrive_len - 1] = '\0';
|
||||||
|
}
|
||||||
|
if (flags)
|
||||||
|
strcpy (flags, (cygdrive_flags & MOUNT_BINARY) ? "binmode" : "textmode");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue