mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-20 04:30:18 +00:00
fix: drop realpath path canon; use GLib-only absolute path build
This commit is contained in:
@@ -1357,6 +1357,24 @@ fe_open_url_is_local_path (const char *url)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char *
|
||||||
|
fe_open_url_canonicalize_path (const char *path)
|
||||||
|
{
|
||||||
|
char *absolute_path;
|
||||||
|
char *cwd;
|
||||||
|
|
||||||
|
if (!path || path[0] == '\0')
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if (g_path_is_absolute (path))
|
||||||
|
return g_strdup (path);
|
||||||
|
|
||||||
|
cwd = g_get_current_dir ();
|
||||||
|
absolute_path = g_build_filename (cwd, path, NULL);
|
||||||
|
g_free (cwd);
|
||||||
|
return absolute_path;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
fe_open_url (const char *url)
|
fe_open_url (const char *url)
|
||||||
{
|
{
|
||||||
@@ -1367,7 +1385,7 @@ fe_open_url (const char *url)
|
|||||||
|
|
||||||
if (fe_open_url_is_local_path (url))
|
if (fe_open_url_is_local_path (url))
|
||||||
{
|
{
|
||||||
path = g_canonicalize_filename (url, NULL);
|
path = fe_open_url_canonicalize_path (url);
|
||||||
path_uri = g_filename_to_uri (path, NULL, NULL);
|
path_uri = g_filename_to_uri (path, NULL, NULL);
|
||||||
g_free (path);
|
g_free (path);
|
||||||
|
|
||||||
@@ -1382,7 +1400,7 @@ fe_open_url (const char *url)
|
|||||||
/* gvfs likes file:// */
|
/* gvfs likes file:// */
|
||||||
if (url_type == WORD_PATH)
|
if (url_type == WORD_PATH)
|
||||||
{
|
{
|
||||||
path = g_canonicalize_filename (url, NULL);
|
path = fe_open_url_canonicalize_path (url);
|
||||||
path_uri = g_filename_to_uri (path, NULL, NULL);
|
path_uri = g_filename_to_uri (path, NULL, NULL);
|
||||||
g_free (path);
|
g_free (path);
|
||||||
if (path_uri)
|
if (path_uri)
|
||||||
|
|||||||
Reference in New Issue
Block a user