# HG changeset patch # User Daniel Atallah # Date 1131685982 0 # Node ID da44f68fb4d20f616a9d302fa86d2c5f1fe89968 # Parent d225a55927dfbde0944b6e30abc7e95aeb5c7a8c [gaim-migrate @ 14334] Lee Roach noticed a little line ending inconsitency. This fixes it. committer: Tailor Script diff -r d225a55927df -r da44f68fb4d2 src/xmlnode.c --- a/src/xmlnode.c Thu Nov 10 22:40:41 2005 +0000 +++ b/src/xmlnode.c Fri Nov 11 05:13:02 2005 +0000 @@ -34,6 +34,12 @@ #include "xmlnode.h" +#ifdef _WIN32 +# define NEWLINE_S "\r\n" +#else +# define NEWLINE_S "\n" +#endif + static xmlnode* new_node(const char *name, XMLNodeType type) { @@ -252,11 +258,6 @@ xmlnode *c; char *node_name, *esc, *esc2, *tab = NULL; gboolean need_end = FALSE, pretty = formatting; -#ifdef _WIN32 - static const char *newline = "\r\n"; -#else - static const char *newline = "\n"; -#endif if(pretty && depth) { tab = g_strnfill(depth, '\t'); @@ -282,7 +283,7 @@ } if(need_end) { - g_string_append_printf(text, ">%s", pretty ? newline : ""); + g_string_append_printf(text, ">%s", pretty ? NEWLINE_S : ""); for(c = node->child; c; c = c->next) { @@ -300,9 +301,9 @@ if(tab && pretty) text = g_string_append(text, tab); - g_string_append_printf(text, "%s", node_name, formatting ? newline : ""); + g_string_append_printf(text, "%s", node_name, formatting ? NEWLINE_S : ""); } else { - g_string_append_printf(text, "/>%s", formatting ? newline : ""); + g_string_append_printf(text, "/>%s", formatting ? NEWLINE_S : ""); } g_free(node_name); @@ -329,7 +330,7 @@ xml = xmlnode_to_str_helper(node, len, TRUE, 0); xml_with_declaration = - g_strdup_printf("\n\n%s", xml); + g_strdup_printf("" NEWLINE_S NEWLINE_S "%s", xml); g_free(xml); return xml_with_declaration;