changeset 13643:68157ab4e1c9

[gaim-migrate @ 16041] Ike Ginerich fixed gaim_markup_slice(). Looks like the way we were using it just happened to work, which explains how I was sure I tested this and it worked and yet it was broken. Go figure. committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Sun, 16 Apr 2006 18:28:53 +0000
parents c99d04f8a42b
children d70f4e25eab5
files COPYRIGHT src/util.c
diffstat 2 files changed, 14 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/COPYRIGHT	Sun Apr 16 15:35:09 2006 +0000
+++ b/COPYRIGHT	Sun Apr 16 18:28:53 2006 +0000
@@ -104,6 +104,7 @@
 François Gagné
 Evgueni V. Gavrilov
 Ignacy Gawedzki
+Ike Gingerich
 Gustavo Giráldez
 Richard Gobeille
 Michael Golden
--- a/src/util.c	Sun Apr 16 15:35:09 2006 +0000
+++ b/src/util.c	Sun Apr 16 18:28:53 2006 +0000
@@ -2121,16 +2121,7 @@
 				/* z += 0; */
 			}
 
-			if (z == x && !appended) {
-				GList *l = q->tail;
-
-				while (l) {
-					tag = l->data;
-					g_string_append(ret, tag);
-					l = l->prev;
-				}
-				appended = TRUE;
-			} else if (z >= x) {
+			if (z >= x) {
 				g_string_append_len(ret, str, end - str + 1);
 			}
 
@@ -2152,6 +2143,17 @@
 			z++;
 			str = end;
 		} else {
+			if (z == x && z > 0 && !appended) {
+				GList *l = q->tail;
+
+				while (l) {
+					tag = l->data;
+					g_string_append(ret, tag);
+					l = l->prev;
+				}
+				appended = TRUE;
+			}
+
 			if (z >= x)
 				g_string_append_unichar(ret, c);
 			z++;
@@ -2184,7 +2186,7 @@
 		if (tag[i] == '>' || tag[i] == ' ' || tag[i] == '/')
 			break;
 
-	return g_strndup(tag, i);
+	return g_strndup(tag+1, i-1);
 }
 
 /**************************************************************************