Lines 902-907
Link Here
|
902 |
const gchar *linenum; |
902 |
const gchar *linenum; |
903 |
glong lineno; |
903 |
glong lineno; |
904 |
gboolean is_local_uri; |
904 |
gboolean is_local_uri; |
|
|
905 |
gchar normalized_path_buf[PATH_MAX]; |
905 |
gchar *normalized_path = NULL; |
906 |
gchar *normalized_path = NULL; |
906 |
|
907 |
|
907 |
IAnjutaEditor *te; |
908 |
IAnjutaEditor *te; |
Lines 926-934
Link Here
|
926 |
/* Get the normalized file path for comparision */ |
927 |
/* Get the normalized file path for comparision */ |
927 |
is_local_uri = gnome_vfs_uri_is_local (vfs_uri); |
928 |
is_local_uri = gnome_vfs_uri_is_local (vfs_uri); |
928 |
if (is_local_uri) |
929 |
if (is_local_uri) |
929 |
normalized_path = realpath (gnome_vfs_uri_get_path (vfs_uri), NULL); |
930 |
normalized_path = realpath (gnome_vfs_uri_get_path (vfs_uri), normalized_path_buf); |
930 |
if (normalized_path == NULL) |
931 |
if (normalized_path == NULL) { |
931 |
normalized_path = g_strdup (uri); |
932 |
(void) strlcpy (normalized_path_buf, uri, PATH_MAX); |
|
|
933 |
normalized_path = normalized_path_buf; |
934 |
} |
932 |
|
935 |
|
933 |
gnome_vfs_uri_unref (vfs_uri); |
936 |
gnome_vfs_uri_unref (vfs_uri); |
934 |
/* g_free(filename); */ |
937 |
/* g_free(filename); */ |
Lines 942-947
Link Here
|
942 |
AnjutaDocmanPage *page; |
945 |
AnjutaDocmanPage *page; |
943 |
gboolean te_is_local_uri; |
946 |
gboolean te_is_local_uri; |
944 |
gchar *te_uri; |
947 |
gchar *te_uri; |
|
|
948 |
char te_normalized_path_buf[PATH_MAX]; |
945 |
gchar *te_normalized_path = NULL; |
949 |
gchar *te_normalized_path = NULL; |
946 |
|
950 |
|
947 |
page = (AnjutaDocmanPage *) node->data; |
951 |
page = (AnjutaDocmanPage *) node->data; |
Lines 959-967
Link Here
|
959 |
te_is_local_uri = gnome_vfs_uri_is_local (vfs_uri); |
963 |
te_is_local_uri = gnome_vfs_uri_is_local (vfs_uri); |
960 |
if (te_is_local_uri) |
964 |
if (te_is_local_uri) |
961 |
te_normalized_path = realpath (gnome_vfs_uri_get_path (vfs_uri), |
965 |
te_normalized_path = realpath (gnome_vfs_uri_get_path (vfs_uri), |
962 |
NULL); |
966 |
te_normalized_path_buf); |
963 |
if (te_normalized_path == NULL) |
967 |
if (te_normalized_path == NULL) { |
964 |
te_normalized_path = g_strdup (te_uri); |
968 |
(void) strlcpy (te_normalized_path_buf, te_uri, PATH_MAX); |
|
|
969 |
te_normalized_path = te_normalized_path_buf; |
970 |
} |
965 |
gnome_vfs_uri_unref (vfs_uri); |
971 |
gnome_vfs_uri_unref (vfs_uri); |
966 |
|
972 |
|
967 |
if (strcmp (normalized_path, te_normalized_path) == 0) |
973 |
if (strcmp (normalized_path, te_normalized_path) == 0) |
Lines 982-993
Link Here
|
982 |
an_file_history_push (te_uri, lineno); |
988 |
an_file_history_push (te_uri, lineno); |
983 |
g_free (uri); |
989 |
g_free (uri); |
984 |
g_free (te_uri); |
990 |
g_free (te_uri); |
985 |
g_free (normalized_path); |
|
|
986 |
g_free (te_normalized_path); |
987 |
return te; |
991 |
return te; |
988 |
} |
992 |
} |
989 |
g_free (te_uri); |
993 |
g_free (te_uri); |
990 |
g_free (te_normalized_path); |
|
|
991 |
node = g_list_next (node); |
994 |
node = g_list_next (node); |
992 |
} |
995 |
} |
993 |
te = anjuta_docman_add_editor (docman, uri, NULL); |
996 |
te = anjuta_docman_add_editor (docman, uri, NULL); |
Lines 1006-1012
Link Here
|
1006 |
} |
1009 |
} |
1007 |
} |
1010 |
} |
1008 |
g_free (uri); |
1011 |
g_free (uri); |
1009 |
g_free (normalized_path); |
|
|
1010 |
return te ; |
1012 |
return te ; |
1011 |
} |
1013 |
} |