# HG changeset patch # User Elliott Sales de Andrade # Date 1248053291 0 # Node ID 1316f2b180bea0b2066a047a5b9336cdb23b205e # Parent 1694eb347a78d5c6adf8cc03696d1e046cbc2416 Make a note about these ALLOW_TAG* macros so people don't do stuff like Mark did again. diff -r 1694eb347a78 -r 1316f2b180be libpurple/util.c --- a/libpurple/util.c Sun Jul 19 23:26:50 2009 +0000 +++ b/libpurple/util.c Mon Jul 20 01:28:11 2009 +0000 @@ -1409,6 +1409,12 @@ gboolean ignore; }; +/* NOTE: Do not put `do {} while(0)` around this macro (as this is the method + recommended in the GCC docs). It contains 'continue's that should + affect the while-loop in purple_markup_html_to_xhtml and doing the + above would break that. + Also, remember to put braces in constructs that require them for + multiple statements when using this macro. */ #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; \ @@ -1479,7 +1485,8 @@ } \ c = strchr(c, '>') + 1; \ continue; \ - } \ + } +/* Don't forget to check the note above for ALLOW_TAG_ALT. */ #define ALLOW_TAG(x) ALLOW_TAG_ALT(x, x) void purple_markup_html_to_xhtml(const char *html, char **xhtml_out,