# HG changeset patch # User Richard Laager # Date 1181960473 0 # Node ID c0cd4d84ba520a0de18c9b3224edb29504bf9e1b # Parent d865909b664699ad0f193c44356d06e02809af09 Fix a mistake noticed by Michael Shkutkov and add a comment explaining the code. diff -r d865909b6646 -r c0cd4d84ba52 libpurple/plugins/log_reader.c --- a/libpurple/plugins/log_reader.c Fri Jun 15 20:52:29 2007 +0000 +++ b/libpurple/plugins/log_reader.c Sat Jun 16 02:21:13 2007 +0000 @@ -1290,9 +1290,16 @@ list = g_list_delete_link(list, last); } } - } else if (line[0] && line[1] && line [3] && + } else if (line[0] && line[1] && line[2] && purple_str_has_prefix(&line[3], "sion Start ")) { - + /* The conditional is to make sure we're not reading off + * the end of the string. We don't want strlen(), as that'd + * have to count the whole string needlessly. + * + * The odd check here is because a Session Start at the + * beginning of the file can be overwritten with a UTF-8 + * byte order mark. Yes, it's weird. + */ char *their_nickname = line; char *timestamp;