# HG changeset patch # User Luke Schierer # Date 1112618468 0 # Node ID 93fd90cbf45cf813a2ebb099387531b36eb2e2ef # Parent f6d630211935df219e82b0102087132f5c897a8e [gaim-migrate @ 12410] Mark is right, I should have committed grim's dnd fix here also committer: Tailor Script diff -r f6d630211935 -r 93fd90cbf45c src/gtkimhtml.c --- a/src/gtkimhtml.c Mon Apr 04 04:35:57 2005 +0000 +++ b/src/gtkimhtml.c Mon Apr 04 12:41:08 2005 +0000 @@ -1536,6 +1536,7 @@ char *text = sd->data; GtkTextMark *mark = gtk_text_buffer_get_insert(imhtml->text_buffer); GtkTextIter iter; + gint i = 0; gtk_text_buffer_get_iter_at_mark(imhtml->text_buffer, &iter, mark); @@ -1545,21 +1546,32 @@ gaim_str_strip_cr(sd->data); links = g_strsplit(sd->data, "\n", 0); - while((link = *links++) != NULL){ + while((link = links[i]) != NULL){ if(gaim_str_has_prefix(link, "http://") || gaim_str_has_prefix(link, "https://") || - gaim_str_has_prefix(link, "ftp://")){ - gtk_imhtml_insert_link(imhtml, mark, link, link); + gaim_str_has_prefix(link, "ftp://")) + { + gchar *label; + + if(links[i + 1]) + i++; + + label = links[i]; + + gtk_imhtml_insert_link(imhtml, mark, link, label); } else if (link=='\0') { /* Ignore blank lines */ } else { /* Special reasons, aka images being put in via other tag, etc. */ /* ... don't pretend we handled it if we didn't */ gtk_drag_finish(dc, FALSE, FALSE, t); + g_strfreev(links); return; } + + i++; } - g_strfreev(links); + g_strfreev(links); break; case GTK_IMHTML_DRAG_HTML: {