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:
authorChristopher Faylor <me@cgf.cx>2010-05-18 18:30:51 +0400
committerChristopher Faylor <me@cgf.cx>2010-05-18 18:30:51 +0400
commitd3258e063cb0a4fc77a76df3c91ba9841ca4971c (patch)
tree2921ded7329f12667d439c207fa81f15575dba14 /winsup/cygwin/exceptions.cc
parentc8bd391c328c8650a93388f5cb3409c3740ee963 (diff)
* environ.cc (regopt): Change the first argument to wide char string.
(environ_init): Accommodate change to the first argument of regopt. * exception.cc (open_stackdumpfile): Accommodate change to the type of progname in _pinfo. * external.cc (fillout_pinfo): Ditto. * fhandler_process.cc (format_process_winexename): Ditto. (format_process_stat): Ditto. * fork.cc (fork::parent): Ditto. * pinfo.cc (pinfo_basic::pinfo_basic): Call GetModuleFileNameW instead of GetModuleFileName. (pinfo::thisproc): Accommodate change to the type of progname in _pinfo. (pinfo_init): Ditto. * pinfo.h (_pinfo): Change the type of progname to a wide char array. * registry.h (reg_key::get_int): Change the first argument from constant point to pointer to constant. (reg_key::get_string): Ditto. Change the last argument likewise. * registry.cc (reg_key::get_int): Accommodate change to the declaration. (reg_key::get_string): Ditto. * strace.cc (strace::hello): Accommodate change to the type of progname in _pinfo. (strace::vsprntf): Ditto.
Diffstat (limited to 'winsup/cygwin/exceptions.cc')
-rw-r--r--winsup/cygwin/exceptions.cc15
1 files changed, 6 insertions, 9 deletions
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index ed72f7967..16a4e190f 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -130,24 +130,21 @@ open_stackdumpfile ()
{
if (myself->progname[0])
{
- const char *p;
+ const WCHAR *p;
/* write to progname.stackdump if possible */
if (!myself->progname[0])
- p = "unknown";
- else if ((p = strrchr (myself->progname, '\\')))
+ p = L"unknown";
+ else if ((p = wcsrchr (myself->progname, L'\\')))
p++;
else
p = myself->progname;
- WCHAR corefile[strlen (p) + sizeof (".stackdump")];
+ WCHAR corefile[wcslen (p) + sizeof (".stackdump")];
+ wcscpy(corefile, p);
UNICODE_STRING ucore;
OBJECT_ATTRIBUTES attr;
/* Create the UNICODE variation of <progname>.stackdump. */
- RtlInitEmptyUnicodeString (&ucore, corefile,
- sizeof corefile - sizeof (WCHAR));
- ucore.Length = sys_mbstowcs (ucore.Buffer,
- ucore.MaximumLength / sizeof (WCHAR),
- p, strlen (p)) * sizeof (WCHAR);
+ RtlInitUnicodeString (&ucore, corefile);
RtlAppendUnicodeToString (&ucore, L".stackdump");
/* Create an object attribute which refers to <progname>.stackdump
in Cygwin's cwd. Stick to caseinsensitivity. */