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>2007-10-23 20:26:28 +0400
committerCorinna Vinschen <corinna@vinschen.de>2007-10-23 20:26:28 +0400
commit09ecdc85044c736c25ac58c0f37b3fb5394c2733 (patch)
tree158a991568397076fdbcca8e4f659241a4ef44d8 /winsup/cygwin/strfuncs.cc
parent5b9de9d9563f4fc14ab3982a61c51cb56fb75946 (diff)
* cygheap.h (struct cwdstuff): Drop hash member. Drop get_hash,
get_initial, and fixup_after_exec declarations. Convert win32 to UNICODE_STRING. (cwdstuff::get_drive): Convert win32 path in current codepage. (cwdstuff::set): Take native NT path. * ntdll.h (struct _TEB): Typedef. * path.cc (mount_info::conv_to_posix_path): Add variant taking wide char DOS paths. (symlink_info::posixify): Simplify concatenating cwd and relative path. (hash_path_name): Drop special relative path handling. (chdir): Drop special "drive only" handling. Call cwdstuff::set with native path. (cwdstuff::get_hash): Remove. (windows_system_directory): Remove. (_upp): Remove. (get_user_proc_parms): Make inline. Get PEB pointer by calling NtCurrentTeb. (cwdstuff::init): Simplify. (cwdstuff::set): Rework to handle incoming native NT path. Workaround a Vista problem with CWD handle in the user process parameter block. (cwdstuff::get): Simplify locking. Accommodate type change of win32. * shared_info.h (mount_info): Add declaration for new conv_to_posix_path method. * strfuncs.cc (sys_wcstombs): Return correct length of created multi-byte string.
Diffstat (limited to 'winsup/cygwin/strfuncs.cc')
-rw-r--r--winsup/cygwin/strfuncs.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/winsup/cygwin/strfuncs.cc b/winsup/cygwin/strfuncs.cc
index 91ed160c3..9d0e3ec08 100644
--- a/winsup/cygwin/strfuncs.cc
+++ b/winsup/cygwin/strfuncs.cc
@@ -32,7 +32,10 @@ sys_wcstombs (char *tgt, int tlen, const WCHAR *src, int slen)
ret = WideCharToMultiByte (get_cp (), 0, src, slen, tgt, tlen, NULL, NULL);
if (ret)
- tgt[ret < tlen ? ret : tlen - 1] = '\0';
+ {
+ ret = (ret < tlen) ? ret : tlen - 1;
+ tgt[ret] = '\0';
+ }
return ret;
}