changeset 17469:3175a063aae1

merge of '1b4ebe4d8d8e94e998ce72e03c6bad7473803e28' and 'e0c7b2e82c91c8d337d3e0280a84ac2b43d90aa4'
author Stu Tomlinson <stu@nosnilmot.com>
date Mon, 04 Jun 2007 01:46:18 +0000
parents 1aa324c47042 (diff) fa5c24086481 (current diff)
children 352d87f05519 ae7a4134e499
files
diffstat 1 files changed, 9 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/plugins/log_reader.c	Mon Jun 04 01:44:22 2007 +0000
+++ b/libpurple/plugins/log_reader.c	Mon Jun 04 01:46:18 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);