aboutsummaryrefslogtreecommitdiff
path: root/src/util/os_installation.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-12-30 22:44:49 +0000
committerChristian Grothoff <christian@grothoff.org>2011-12-30 22:44:49 +0000
commitd60192bbfe69cb3d8e36afaf459f72bb9fa4d288 (patch)
tree5feadcb1dc083dc1dd166f31c101242db6c0567b /src/util/os_installation.c
parentf5a017ed63ee50feeefc6f0c2b28549aeca92ded (diff)
downloadgnunet-d60192bbfe69cb3d8e36afaf459f72bb9fa4d288.tar.gz
gnunet-d60192bbfe69cb3d8e36afaf459f72bb9fa4d288.zip
-LRN: utf8-ization, #2051
Diffstat (limited to 'src/util/os_installation.c')
-rw-r--r--src/util/os_installation.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/util/os_installation.c b/src/util/os_installation.c
index 6d25c5709..c0b7c8583 100644
--- a/src/util/os_installation.c
+++ b/src/util/os_installation.c
@@ -112,15 +112,19 @@ get_path_from_proc_exe ()
112static char * 112static char *
113get_path_from_module_filename () 113get_path_from_module_filename ()
114{ 114{
115 char path[4097]; 115 wchar_t path[4097];
116 char *idx; 116 char upath[4097];
117 wchar_t *idx;
117 118
118 GetModuleFileName (NULL, path, sizeof (path) - 1); 119 GetModuleFileNameW (NULL, path, sizeof (path) - 1);
119 idx = path + strlen (path); 120 idx = path + wcslen (path);
120 while ((idx > path) && (*idx != '\\') && (*idx != '/')) 121 while ((idx > path) && (*idx != L'\\') && (*idx != L'/'))
121 idx--; 122 idx--;
122 *idx = '\0'; 123 *idx = L'\0';
123 return GNUNET_strdup (path); 124 upath[0] = '\0';
125 WideCharToMultiByte (CP_UTF8, 0, path, -1, upath, 4097, NULL, NULL);
126
127 return GNUNET_strdup (upath);
124} 128}
125#endif 129#endif
126 130