[geany/geany] ca340a: Properly handle remote URIs received through drag 'n drop

Colomban Wendling git-noreply at xxxxx
Thu Jul 26 00:03:13 UTC 2012


Branch:      refs/heads/document-messages
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);


@@ Diff output truncated at 100000 characters. @@


--------------
This E-Mail was brought to you by github_commit_mail.py (Source: TBD).



More information about the Commits mailing list