Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2009-03-14 17:58:05 +0300
committerCorinna Vinschen <corinna@vinschen.de>2009-03-14 17:58:05 +0300
commit5c8c49cc43837470e6d9096b99bbed2b0481b806 (patch)
treed09a8a9d0588ca894912f89ca176bb3eb4302d1b /winsup/utils
parent26fb7ef5e4bb99f5766189c5edd722f093776aef (diff)
* path.cc (from_fstab): Use wcstombs/mbstowcs instead of
WideCharToMultiByte/MultiByteToWideChar to accommodate current locale.
Diffstat (limited to 'winsup/utils')
-rw-r--r--winsup/utils/ChangeLog5
-rw-r--r--winsup/utils/path.cc8
2 files changed, 8 insertions, 5 deletions
diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog
index e4c433cfc..09f570077 100644
--- a/winsup/utils/ChangeLog
+++ b/winsup/utils/ChangeLog
@@ -1,5 +1,10 @@
2009-03-14 Corinna Vinschen <corinna@vinschen.de>
+ * path.cc (from_fstab): Use wcstombs/mbstowcs instead of
+ WideCharToMultiByte/MultiByteToWideChar to accommodate current locale.
+
+2009-03-14 Corinna Vinschen <corinna@vinschen.de>
+
* wide_path.h (class wide_path): New class to convert Windows path
to WCHAR win32 path, including long path conversion if necessary.
* cygcheck.cc: Use class wide_path throughout to call Win32 functions
diff --git a/winsup/utils/path.cc b/winsup/utils/path.cc
index 787467f1d..817c4c874 100644
--- a/winsup/utils/path.cc
+++ b/winsup/utils/path.cc
@@ -1,6 +1,6 @@
/* path.cc
- Copyright 2001, 2002, 2003, 2005, 2006, 2007, 2008 Red Hat, Inc.
+ Copyright 2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009 Red Hat, Inc.
This file is part of Cygwin.
@@ -435,8 +435,7 @@ from_fstab (bool user, PWCHAR path, PWCHAR path_end)
if (!user)
{
/* Create a default root dir from path. */
- WideCharToMultiByte (GetACP (), 0, path, -1, buf, BUFSIZE,
- NULL, NULL);
+ wcstombs (buf, path, BUFSIZE);
unconvert_slashes (buf);
char *native_path = buf;
if (!strncmp (native_path, "\\\\?\\", 4))
@@ -459,8 +458,7 @@ from_fstab (bool user, PWCHAR path, PWCHAR path_end)
PWCHAR u = wcscpy (path_end, L"\\etc\\fstab") + 10;
if (user)
- MultiByteToWideChar (GetACP (), 0, get_user (), -1,
- wcscpy (u, L".d\\") + 3, BUFSIZE - (u - path));
+ mbstowcs (wcscpy (u, L".d\\") + 3, get_user (), BUFSIZE - (u - path));
HANDLE h = CreateFileW (path, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (h == INVALID_HANDLE_VALUE)