comparison libpurple/plugins/log_reader.c @ 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
comparison
equal deleted inserted replaced
18251:8908e9ec2420 18252:6722bbd698ff
1839 /* find EOL */ 1839 /* find EOL */
1840 c = strstr(c, "\n"); 1840 c = strstr(c, "\n");
1841 c++; 1841 c++;
1842 1842
1843 /* Find the last '(' character. */ 1843 /* Find the last '(' character. */
1844 if ((tmp = strstr(c, "\n")) != NULL) 1844 if ((tmp = strstr(c, "\n")) != NULL) {
1845 c = g_strrstr(tmp, "("); 1845 while (*tmp && *tmp != '(') --tmp;
1846 else { 1846 c = tmp;
1847 } else {
1847 while (*c) 1848 while (*c)
1848 c++; 1849 c++;
1849 c--; 1850 c--;
1850 c = g_strrstr(c, "("); 1851 c = g_strrstr(c, "(");
1851 } 1852 }
1899 1900
1900 prev_tm = tm; 1901 prev_tm = tm;
1901 start_log = new_line; 1902 start_log = new_line;
1902 } 1903 }
1903 } 1904 }
1904
1905 /* find EOF */
1906 c = strstr(c, "\n");
1907 c++;
1908 } 1905 }
1906 /* find EOF */
1907 c = strstr(c, "\n");
1908 c++;
1909 } 1909 }
1910 } else { 1910 } else {
1911 c = strstr(c, "\n"); 1911 c = strstr(c, "\n");
1912 c++; 1912 c++;
1913 } 1913 }
1994 1994
1995 /* XXX: Do we need buddy_name when we have buddy->alias? */ 1995 /* XXX: Do we need buddy_name when we have buddy->alias? */
1996 buddy_name = ++c; 1996 buddy_name = ++c;
1997 1997
1998 /* Find the last '(' character. */ 1998 /* Find the last '(' character. */
1999 if ((tmp = strstr(c, "\n")) != NULL) 1999 if ((tmp = strstr(c, "\n")) != NULL) {
2000 c = g_strrstr(tmp, "("); 2000 while (*tmp && *tmp != '(') --tmp;
2001 else { 2001 c = tmp;
2002 } else {
2002 while (*c) 2003 while (*c)
2003 c++; 2004 c++;
2004 c--; 2005 c--;
2005 c = g_strrstr(c, "("); 2006 c = g_strrstr(c, "(");
2006 } 2007 }