[geany/geany] ca340a: Properly handle remote URIs received through drag 'n drop
Colomban Wendling
git-noreply at xxxxx
Tue Jan 31 14:22:20 UTC 2012
Branch: refs/heads/master
Author: Colomban Wendling <ban at herbesfolles.org>
Committer: Colomban Wendling <ban at herbesfolles.org>
Date: Tue, 31 Jan 2012 14:22:20
Commit: ca340a8aa332e0c9ff4e5a5f54de944d6a091a74
https://github.com/geany/geany/commit/ca340a8aa332e0c9ff4e5a5f54de944d6a091a74
Log Message:
-----------
Properly handle remote URIs received through drag 'n drop
Closes #2966770, #3479567.
Modified Paths:
--------------
src/document.c
Modified: src/document.c
7 files changed, 4 insertions(+), 3 deletions(-)
===================================================================
@@ -1246,10 +1246,11 @@ void document_open_file_list(const gchar *data, gsize length)
list = g_strsplit(data, utils_get_eol_char(utils_get_line_endings(data, length)), 0);
- for (i = 0; list[i] != NULL; i++)
+ /* stop at the end or first empty item, because last item is empty but not null */
+ for (i = 0; list[i] != NULL && list[i][0] != '\0'; i++)
{
- filename = g_filename_from_uri(list[i], NULL, NULL);
- if (G_UNLIKELY(filename == NULL))
+ filename = utils_get_path_from_uri(list[i]);
+ if (filename == NULL)
continue;
document_open_file(filename, FALSE, NULL, NULL);
g_free(filename);
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: TBD).
More information about the Commits
mailing list