From d7d0cffbd7cc936ac8e1ed327f7c6f8f7281f37e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 17 Jan 2011 11:39:44 +0000 Subject: [PATCH] 2011-01-17 12:38 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbmxml/3rd/minixml/mxml.hbp * contrib/hbmxml/3rd/minixml/mxml_fil.c + Patched libmxml code to create native CRLF EOL on win/dos/os2 platforms. --- harbour/ChangeLog | 5 +++ harbour/contrib/hbmxml/3rd/minixml/mxml.hbp | 1 + harbour/contrib/hbmxml/3rd/minixml/mxml_fil.c | 33 +++++++++++++++++++ 3 files changed, 39 insertions(+) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 232decfcb4..cb179403ed 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,11 @@ The license applies to all entries newer than 2009-04-28. */ +2011-01-17 12:38 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbmxml/3rd/minixml/mxml.hbp + * contrib/hbmxml/3rd/minixml/mxml_fil.c + + Patched libmxml code to create native CRLF EOL on win/dos/os2 platforms. + 2011-01-17 12:14 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/contrib/hbmxml/hbmxml.c * use hb_parstr_utf8() instead of hb_parc() in custom_save_cb() diff --git a/harbour/contrib/hbmxml/3rd/minixml/mxml.hbp b/harbour/contrib/hbmxml/3rd/minixml/mxml.hbp index f959fc0e42..a6e631b360 100644 --- a/harbour/contrib/hbmxml/3rd/minixml/mxml.hbp +++ b/harbour/contrib/hbmxml/3rd/minixml/mxml.hbp @@ -11,6 +11,7 @@ -cpp=no {win}-cflag=-DWIN32 -DWIN +{win|dos|os2}-cflag=-D_EOL_CRLF mxml_att.c mxml_ent.c diff --git a/harbour/contrib/hbmxml/3rd/minixml/mxml_fil.c b/harbour/contrib/hbmxml/3rd/minixml/mxml_fil.c index 509a9a8a0e..60da0cf691 100644 --- a/harbour/contrib/hbmxml/3rd/minixml/mxml_fil.c +++ b/harbour/contrib/hbmxml/3rd/minixml/mxml_fil.c @@ -329,8 +329,14 @@ mxmlSaveFd(mxml_node_t *node, /* I - Node to write */ return (-1); if (col > 0) + { +#ifdef _EOL_CRLF + if (mxml_fd_putc('\r', &buf) < 0) + return (-1); +#endif if (mxml_fd_putc('\n', &buf) < 0) return (-1); + } /* * Flush and return... @@ -368,8 +374,14 @@ mxmlSaveFile(mxml_node_t *node, /* I - Node to write */ return (-1); if (col > 0) + { +#ifdef _EOL_CRLF + if (putc('\r', fp) < 0) + return (-1); +#endif if (putc('\n', fp) < 0) return (-1); + } /* * Return 0 (success)... @@ -416,7 +428,12 @@ mxmlSaveString(mxml_node_t *node, /* I - Node to write */ return (-1); if (col > 0) + { +#ifdef _EOL_CRLF + mxml_string_putc('\r', ptr); +#endif mxml_string_putc('\n', ptr); + } /* * Nul-terminate the buffer... @@ -2782,6 +2799,10 @@ mxml_write_node(mxml_node_t *node, /* I - Node to write */ if (global->wrap > 0 && (col + width) > global->wrap) { +#ifdef _EOL_CRLF + if ((*putc_cb)('\r', p) < 0) + return (-1); +#endif if ((*putc_cb)('\n', p) < 0) return (-1); @@ -2892,6 +2913,10 @@ mxml_write_node(mxml_node_t *node, /* I - Node to write */ { if (global->wrap > 0 && col > global->wrap) { +#ifdef _EOL_CRLF + if ((*putc_cb)('\r', p) < 0) + return (-1); +#endif if ((*putc_cb)('\n', p) < 0) return (-1); @@ -2922,6 +2947,10 @@ mxml_write_node(mxml_node_t *node, /* I - Node to write */ { if (global->wrap > 0 && col > global->wrap) { +#ifdef _EOL_CRLF + if ((*putc_cb)('\r', p) < 0) + return (-1); +#endif if ((*putc_cb)('\n', p) < 0) return (-1); @@ -2945,6 +2974,10 @@ mxml_write_node(mxml_node_t *node, /* I - Node to write */ { if (global->wrap > 0 && col > global->wrap) { +#ifdef _EOL_CRLF + if ((*putc_cb)('\r', p) < 0) + return (-1); +#endif if ((*putc_cb)('\n', p) < 0) return (-1);