pidgin: 0cb961a5: Add some comments that meant something t...

nosnilmot at pidgin.im nosnilmot at pidgin.im
Sun May 16 20:25:27 EDT 2010


-----------------------------------------------------------------
Revision: 0cb961a579828ba1b98b6e7599bf2719e7c7bebf
Ancestor: 13fbe0815f84d5b3c001947559f5818c10275f4c
Author: nosnilmot at pidgin.im
Date: 2010-05-17T00:14:22
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/0cb961a579828ba1b98b6e7599bf2719e7c7bebf

Modified files:
        libpurple/util.c

ChangeLog: 

Add some comments that meant something to me at some point and might
conceivably mean something to someone else in the future

-------------- next part --------------
============================================================
--- libpurple/util.c	807eb07e5315efd98f8e70facbb71e7928898f59
+++ libpurple/util.c	92788a8d213e33a08a93cd656dc1348ed73aa8e6
@@ -1308,12 +1308,17 @@ struct purple_parse_tag {
 #define ALLOW_TAG_ALT(x, y) if(!g_ascii_strncasecmp(c, "<" x " ", strlen("<" x " "))) { \
 						const char *o = c + strlen("<" x); \
 						const char *p = NULL, *q = NULL, *r = NULL; \
+						/* o = iterating over full tag \
+						 * p = > (end of tag) \
+						 * q = start of quoted bit \
+						 * r = < inside tag \
+						 */ \
 						GString *innards = g_string_new(""); \
 						while(o && *o) { \
 							if(!q && (*o == '\"' || *o == '\'') ) { \
 								q = o; \
 							} else if(q) { \
-								if(*o == *q) { \
+								if(*o == *q) { /* end of quoted bit */ \
 									char *unescaped = g_strndup(q+1, o-q-1); \
 									char *escaped = g_markup_escape_text(unescaped, -1); \
 									g_string_append_printf(innards, "%c%s%c", *q, escaped, *q); \
@@ -1333,7 +1338,7 @@ struct purple_parse_tag {
 							} \
 							o++; \
 						} \
-						if(p && !r) { \
+						if(p && !r) { /* got an end of tag and no other < earlier */\
 							if(*(p-1) != '/') { \
 								struct purple_parse_tag *pt = g_new0(struct purple_parse_tag, 1); \
 								pt->src_tag = x; \
@@ -1346,7 +1351,7 @@ struct purple_parse_tag {
 								xhtml = g_string_append_c(xhtml, '>'); \
 							} \
 							c = p + 1; \
-						} else { \
+						} else { /* got end of tag with earlier < *or* didn't get anything */ \
 							if(xhtml) \
 								xhtml = g_string_append(xhtml, "&lt;"); \
 							if(plain) \


More information about the Commits mailing list