char *lgu;
GNUNET_snprintf (fn, sizeof (fn), "/proc/%u/maps", getpid ());
- f = fopen (fn, "r");
+ f = FOPEN (fn, "r");
if (f == NULL)
return NULL;
while (NULL != fgets (line, sizeof (line), f))
(NULL != (lgu = strstr (dir, "libgnunetutil"))))
{
lgu[0] = '\0';
- fclose (f);
+ FCLOSE (f);
return GNUNET_strdup (dir);
}
}
- fclose (f);
+ FCLOSE (f);
return NULL;
}
static char *
get_path_from_module_filename ()
{
- char path[4097];
- char *idx;
+ wchar_t path[4097];
+ char upath[4097];
+ wchar_t *idx;
- GetModuleFileName (NULL, path, sizeof (path) - 1);
- idx = path + strlen (path);
- while ((idx > path) && (*idx != '\\') && (*idx != '/'))
+ GetModuleFileNameW (NULL, path, sizeof (path) - 1);
+ idx = path + wcslen (path);
+ while ((idx > path) && (*idx != L'\\') && (*idx != L'/'))
idx--;
- *idx = '\0';
- return GNUNET_strdup (path);
+ *idx = L'\0';
+ upath[0] = '\0';
+ WideCharToMultiByte (CP_UTF8, 0, path, -1, upath, 4097, NULL, NULL);
+
+ return GNUNET_strdup (upath);
}
#endif
dirname =
DIR_SEPARATOR_STR "share" DIR_SEPARATOR_STR "icons" DIR_SEPARATOR_STR;
break;
+ case GNUNET_OS_IPK_DOCDIR:
+ dirname =
+ DIR_SEPARATOR_STR "share" DIR_SEPARATOR_STR "doc" DIR_SEPARATOR_STR \
+ "gnunet" DIR_SEPARATOR_STR;
+ break;
default:
GNUNET_free (execpath);
return NULL;