# HG changeset patch # User Michael Shkutkov # Date 1182851440 0 # Node ID 6722bbd698ffc80c0bcea83090e081941f5bb70c # Parent 8908e9ec242081c554e1eabc435e61928aa3ea90 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. diff -r 8908e9ec2420 -r 6722bbd698ff libpurple/plugins/log_reader.c --- 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--;