changeset 18252:6722bbd698ff

using while cycle instead of g_strrstr, because g_strrstr doesn't work properly. g_strrstr finds the last '(' of the string, not the line.
author Michael Shkutkov <mshkutkov@soc.pidgin.im>
date Tue, 26 Jun 2007 09:50:40 +0000
parents 8908e9ec2420
children 30c1f3984c55
files libpurple/plugins/log_reader.c
diffstat 1 files changed, 11 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/plugins/log_reader.c	Mon Jun 25 00:47:02 2007 +0000
+++ b/libpurple/plugins/log_reader.c	Tue Jun 26 09:50:40 2007 +0000
@@ -1841,9 +1841,10 @@
 			c++;
 
 			/* Find the last '(' character. */
-			if ((tmp = strstr(c, "\n")) != NULL)
-				c = g_strrstr(tmp, "(");
-			else {
+			if ((tmp = strstr(c, "\n")) != NULL) {
+				while (*tmp && *tmp != '(') --tmp;
+				c = tmp;
+			} else {
 				while (*c)
 					c++;
 				c--;
@@ -1901,11 +1902,10 @@
 							start_log = new_line;
 						}
 					}
-
-					/* find EOF */
-					c = strstr(c, "\n");
-					c++;
 				}
+				/* find EOF */
+				c = strstr(c, "\n");
+				c++;
 			}
 		} else {
 			c = strstr(c, "\n");
@@ -1996,9 +1996,10 @@
 			buddy_name = ++c;
 
 			/* Find the last '(' character. */
-			if ((tmp = strstr(c, "\n")) != NULL)
-				c = g_strrstr(tmp, "(");
-			else {
+			if ((tmp = strstr(c, "\n")) != NULL) {
+				while (*tmp && *tmp != '(') --tmp;
+				c = tmp;
+			} else {
 				while (*c)
 					c++;
 				c--;