changeset 17691:1aa324c47042

merge of 'be9e03b2c65a8c0da6ba02fdfd489bc5ec8af57b' and 'c0d55a0b53b511c96041c3888b0803d549e4cdc4'
author Richard Laager <rlaager@wiktel.com>
date Mon, 04 Jun 2007 01:41:23 +0000
parents 582cf53510b9 (current diff) f94251004e7d (diff)
children 0e22098e1421 3175a063aae1
files
diffstat 1 files changed, 9 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/plugins/log_reader.c	Mon Jun 04 01:32:47 2007 +0000
+++ b/libpurple/plugins/log_reader.c	Mon Jun 04 01:41:23 2007 +0000
@@ -1484,35 +1484,28 @@
 			 * </a>
 			 */
 			link_temp_line = NULL;
-			while ((link = g_strstr_len(line, strlen(line), "(Link: "))) {
+			while ((link = strstr(line, "(Link: "))) {
 				GString *temp;
 
-				if (!*link)
-					continue;
-
 				*link = '\0';
-				link++;
-
 				temp = g_string_new(line);
 				g_string_append(temp, "<a href=\"");
 
-				if (strlen(link) >= 6) {
-					link += (sizeof("(Link: ") - 1);
-
+				link += (sizeof("(Link: ") - 1);
+				if (*link) {
 					while (*link && *link != ')') {
 						g_string_append_c(temp, *link);
 						link++;
 					}
-					if (link) {
+					if (*link)
 						link++;
 
-						g_string_append(temp, "\">");
-						while (*link && *link != ' ') {
-							g_string_append_c(temp, *link);
-							link++;
-						}
-						g_string_append(temp, "</a>");
+					g_string_append(temp, "\">");
+					while (*link && *link != ' ') {
+						g_string_append_c(temp, *link);
+						link++;
 					}
+					g_string_append(temp, "</a>");
 
 					g_string_append(temp, link);