* path.cc (conv_path_list): Fix a condition.
(cygwin_conv_path): Revert WIN_A conversion to current locale codeset.
This commit is contained in:
parent
3780d205cd
commit
5250e27f71
|
@ -1,3 +1,8 @@
|
||||||
|
2011-12-13 Corinna Vinschen <vinschen@redhat.com>
|
||||||
|
|
||||||
|
* path.cc (conv_path_list): Fix a condition.
|
||||||
|
(cygwin_conv_path): Revert WIN_A conversion to current locale codeset.
|
||||||
|
|
||||||
2011-12-13 Corinna Vinschen <vinschen@redhat.com>
|
2011-12-13 Corinna Vinschen <vinschen@redhat.com>
|
||||||
|
|
||||||
* fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Call
|
* fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Call
|
||||||
|
|
|
@ -1368,7 +1368,7 @@ conv_path_list (const char *src, char *dst, size_t size,
|
||||||
what = CCP_WIN_A_TO_POSIX | CCP_RELATIVE;
|
what = CCP_WIN_A_TO_POSIX | CCP_RELATIVE;
|
||||||
env_cvt = true;
|
env_cvt = true;
|
||||||
}
|
}
|
||||||
if (what & CCP_WIN_A_TO_POSIX)
|
if ((what & CCP_CONVTYPE_MASK) == CCP_WIN_A_TO_POSIX)
|
||||||
{
|
{
|
||||||
src_delim = ';';
|
src_delim = ';';
|
||||||
dst_delim = ':';
|
dst_delim = ':';
|
||||||
|
@ -2946,7 +2946,7 @@ cygwin_conv_path (cygwin_conv_path_t what, const void *from, void *to,
|
||||||
PWCHAR path = NULL;
|
PWCHAR path = NULL;
|
||||||
int error = 0;
|
int error = 0;
|
||||||
bool relative = !!(what & CCP_RELATIVE);
|
bool relative = !!(what & CCP_RELATIVE);
|
||||||
what &= ~CCP_RELATIVE;
|
what &= CCP_CONVTYPE_MASK;
|
||||||
|
|
||||||
switch (what)
|
switch (what)
|
||||||
{
|
{
|
||||||
|
@ -2959,11 +2959,8 @@ cygwin_conv_path (cygwin_conv_path_t what, const void *from, void *to,
|
||||||
return_with_errno (p.error);
|
return_with_errno (p.error);
|
||||||
PUNICODE_STRING up = p.get_nt_native_path ();
|
PUNICODE_STRING up = p.get_nt_native_path ();
|
||||||
buf = tp.c_get ();
|
buf = tp.c_get ();
|
||||||
UINT cp = AreFileApisANSI () ? CP_ACP : CP_OEMCP;
|
sys_wcstombs (buf, NT_MAX_PATH,
|
||||||
int len = WideCharToMultiByte (cp, WC_NO_BEST_FIT_CHARS,
|
up->Buffer, up->Length / sizeof (WCHAR));
|
||||||
up->Buffer, up->Length / sizeof (WCHAR),
|
|
||||||
buf, NT_MAX_PATH, NULL, NULL);
|
|
||||||
buf[len] = '\0';
|
|
||||||
/* Convert native path to standard DOS path. */
|
/* Convert native path to standard DOS path. */
|
||||||
if (!strncmp (buf, "\\??\\", 4))
|
if (!strncmp (buf, "\\??\\", 4))
|
||||||
{
|
{
|
||||||
|
@ -2975,14 +2972,12 @@ cygwin_conv_path (cygwin_conv_path_t what, const void *from, void *to,
|
||||||
{
|
{
|
||||||
/* Device name points to somewhere else in the NT namespace.
|
/* Device name points to somewhere else in the NT namespace.
|
||||||
Use GLOBALROOT prefix to convert to Win32 path. */
|
Use GLOBALROOT prefix to convert to Win32 path. */
|
||||||
char *p = buf + WideCharToMultiByte (cp, WC_NO_BEST_FIT_CHARS,
|
char *p = buf + sys_wcstombs (buf, NT_MAX_PATH,
|
||||||
ro_u_globalroot.Buffer,
|
ro_u_globalroot.Buffer,
|
||||||
ro_u_globalroot.Length / sizeof (WCHAR),
|
ro_u_globalroot.Length
|
||||||
buf, NT_MAX_PATH, NULL, NULL);
|
/ sizeof (WCHAR));
|
||||||
len = WideCharToMultiByte (cp, WC_NO_BEST_FIT_CHARS,
|
sys_wcstombs (p, NT_MAX_PATH - (p - buf),
|
||||||
up->Buffer, up->Length / sizeof (WCHAR),
|
up->Buffer, up->Length / sizeof (WCHAR));
|
||||||
p, NT_MAX_PATH - (p - buf), NULL, NULL);
|
|
||||||
p[len] = '\0';
|
|
||||||
}
|
}
|
||||||
lsiz = strlen (buf) + 1;
|
lsiz = strlen (buf) + 1;
|
||||||
/* TODO: Incoming "." is a special case which leads to a trailing
|
/* TODO: Incoming "." is a special case which leads to a trailing
|
||||||
|
@ -3054,16 +3049,12 @@ cygwin_conv_path (cygwin_conv_path_t what, const void *from, void *to,
|
||||||
lsiz *= sizeof (WCHAR);
|
lsiz *= sizeof (WCHAR);
|
||||||
break;
|
break;
|
||||||
case CCP_WIN_A_TO_POSIX:
|
case CCP_WIN_A_TO_POSIX:
|
||||||
{
|
buf = tp.c_get ();
|
||||||
UINT cp = AreFileApisANSI () ? CP_ACP : CP_OEMCP;
|
error = mount_table->conv_to_posix_path ((const char *) from, buf,
|
||||||
PWCHAR wbuf = tp.w_get ();
|
relative);
|
||||||
MultiByteToWideChar (cp, 0, (const char *) from, -1, wbuf, NT_MAX_PATH);
|
if (error)
|
||||||
buf = tp.c_get ();
|
return_with_errno (error);
|
||||||
error = mount_table->conv_to_posix_path (wbuf, buf, relative);
|
lsiz = strlen (buf) + 1;
|
||||||
if (error)
|
|
||||||
return_with_errno (error);
|
|
||||||
lsiz = strlen (buf) + 1;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case CCP_WIN_W_TO_POSIX:
|
case CCP_WIN_W_TO_POSIX:
|
||||||
buf = tp.c_get ();
|
buf = tp.c_get ();
|
||||||
|
|
Loading…
Reference in New Issue