From c804b407662078cd621a882ed3fe805c1ac7a180 Mon Sep 17 00:00:00 2001 From: rhk Date: Mon, 13 Sep 2010 14:46:43 +0000 Subject: [PATCH] [packages] ezxml: clean patch headers and new ezxml_cut patch git-svn-id: svn://svn.openwrt.org/openwrt/packages@23053 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- libs/ezxml/patches/100-cross_compile.patch | 5 ++--- libs/ezxml/patches/101-build_shared.patch | 5 ++--- libs/ezxml/patches/200-ezxml_parse_str_d.patch | 12 +++++------- libs/ezxml/patches/300-ezxml_int.patch | 10 ++++------ libs/ezxml/patches/400-ezxml_child.patch | 5 ++--- libs/ezxml/patches/500-ezxml_cut.patch | 23 +++++++++++++++++++++++ 6 files changed, 38 insertions(+), 22 deletions(-) create mode 100644 libs/ezxml/patches/500-ezxml_cut.patch diff --git a/libs/ezxml/patches/100-cross_compile.patch b/libs/ezxml/patches/100-cross_compile.patch index 28a8164c6..dd3ef3d15 100644 --- a/libs/ezxml/patches/100-cross_compile.patch +++ b/libs/ezxml/patches/100-cross_compile.patch @@ -1,6 +1,5 @@ -diff -pruN ezxml-0.8.6.orig/GNUmakefile ezxml-0.8.6/GNUmakefile ---- ezxml-0.8.6.orig/GNUmakefile 2007-08-30 17:38:55.000000000 +0200 -+++ ezxml-0.8.6/GNUmakefile 2007-08-30 17:41:12.000000000 +0200 +--- a/GNUmakefile ++++ b/GNUmakefile @@ -21,10 +21,10 @@ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/libs/ezxml/patches/101-build_shared.patch b/libs/ezxml/patches/101-build_shared.patch index 988868686..e3124f073 100644 --- a/libs/ezxml/patches/101-build_shared.patch +++ b/libs/ezxml/patches/101-build_shared.patch @@ -1,6 +1,5 @@ -diff -pruN ezxml-0.8.6.orig/GNUmakefile ezxml-0.8.6/GNUmakefile ---- ezxml-0.8.6.orig/GNUmakefile 2008-12-16 15:22:46.773434689 +0100 -+++ ezxml-0.8.6/GNUmakefile 2008-12-16 15:22:27.337440224 +0100 +--- a/GNUmakefile ++++ b/GNUmakefile @@ -28,6 +28,7 @@ RM = rm -f DEBUG_CFLAGS = -O0 -g OBJS = ezxml.o diff --git a/libs/ezxml/patches/200-ezxml_parse_str_d.patch b/libs/ezxml/patches/200-ezxml_parse_str_d.patch index 17d5efaef..dd65defb2 100644 --- a/libs/ezxml/patches/200-ezxml_parse_str_d.patch +++ b/libs/ezxml/patches/200-ezxml_parse_str_d.patch @@ -1,7 +1,6 @@ -diff -pruN ezxml-0.8.6.orig/ezxml.c ezxml-0.8.6/ezxml.c ---- ezxml-0.8.6.orig/ezxml.c 2006-06-08 04:33:38.000000000 +0200 -+++ ezxml-0.8.6/ezxml.c 2008-02-15 14:35:17.000000000 +0100 -@@ -599,6 +599,19 @@ ezxml_t ezxml_parse_str(char *s, size_t +--- a/ezxml.c ++++ b/ezxml.c +@@ -599,6 +599,19 @@ ezxml_t ezxml_parse_str(char *s, size_t else return ezxml_err(root, d, "unclosed tag <%s>", root->cur->name); } @@ -21,9 +20,8 @@ diff -pruN ezxml-0.8.6.orig/ezxml.c ezxml-0.8.6/ezxml.c // Wrapper for ezxml_parse_str() that accepts a file stream. Reads the entire // stream into memory and then parses it. For xml files, use ezxml_parse_file() // or ezxml_parse_fd() -diff -pruN ezxml-0.8.6.orig/ezxml.h ezxml-0.8.6/ezxml.h ---- ezxml-0.8.6.orig/ezxml.h 2006-06-08 03:57:30.000000000 +0200 -+++ ezxml-0.8.6/ezxml.h 2008-02-15 14:37:15.000000000 +0100 +--- a/ezxml.h ++++ b/ezxml.h @@ -59,6 +59,11 @@ struct ezxml { // pass in the copy. Returns NULL on failure. ezxml_t ezxml_parse_str(char *s, size_t len); diff --git a/libs/ezxml/patches/300-ezxml_int.patch b/libs/ezxml/patches/300-ezxml_int.patch index 00a3d18cc..1616bd5f8 100644 --- a/libs/ezxml/patches/300-ezxml_int.patch +++ b/libs/ezxml/patches/300-ezxml_int.patch @@ -1,6 +1,5 @@ -diff -pruN ezxml-0.8.6.orig/ezxml.c ezxml-0.8.6/ezxml.c ---- ezxml-0.8.6.orig/ezxml.c 2008-12-16 17:02:17.262312778 +0100 -+++ ezxml-0.8.6/ezxml.c 2008-12-16 17:03:24.231073153 +0100 +--- a/ezxml.c ++++ b/ezxml.c @@ -25,6 +25,7 @@ #include #include @@ -86,9 +85,8 @@ diff -pruN ezxml-0.8.6.orig/ezxml.c ezxml-0.8.6/ezxml.c // sets a flag for the given tag and returns the tag ezxml_t ezxml_set_flag(ezxml_t xml, short flag) { -diff -pruN ezxml-0.8.6.orig/ezxml.h ezxml-0.8.6/ezxml.h ---- ezxml-0.8.6.orig/ezxml.h 2008-12-16 17:02:17.262312778 +0100 -+++ ezxml-0.8.6/ezxml.h 2008-12-16 17:03:44.189450448 +0100 +--- a/ezxml.h ++++ b/ezxml.h @@ -95,9 +95,13 @@ ezxml_t ezxml_idx(ezxml_t xml, int idx); // returns the given tag's character content or empty string if none #define ezxml_txt(xml) ((xml) ? xml->txt : "") diff --git a/libs/ezxml/patches/400-ezxml_child.patch b/libs/ezxml/patches/400-ezxml_child.patch index 46d2faa08..96e30858a 100644 --- a/libs/ezxml/patches/400-ezxml_child.patch +++ b/libs/ezxml/patches/400-ezxml_child.patch @@ -1,6 +1,5 @@ -diff -pruN ezxml-0.8.6.orig/ezxml.h ezxml-0.8.6/ezxml.h ---- ezxml-0.8.6.orig/ezxml.h 2008-12-16 17:07:47.585487234 +0100 -+++ ezxml-0.8.6/ezxml.h 2008-12-16 17:08:29.037939949 +0100 +--- a/ezxml.h ++++ b/ezxml.h @@ -175,6 +175,17 @@ ezxml_t ezxml_insert(ezxml_t xml, ezxml_ // removes a tag along with all its subtags #define ezxml_remove(xml) ezxml_free(ezxml_cut(xml)) diff --git a/libs/ezxml/patches/500-ezxml_cut.patch b/libs/ezxml/patches/500-ezxml_cut.patch new file mode 100644 index 000000000..63642dee8 --- /dev/null +++ b/libs/ezxml/patches/500-ezxml_cut.patch @@ -0,0 +1,23 @@ +--- a/ezxml.c ++++ b/ezxml.c +@@ -1042,7 +1042,7 @@ ezxml_t ezxml_cut(ezxml_t xml) + + cur = xml->parent->child; // go back to head of subtag list + if (strcmp(cur->name, xml->name)) { // not in first sibling list +- while (strcmp(cur->sibling->name, xml->name)) ++ while (cur->sibling && strcmp(cur->sibling->name, xml->name)) + cur = cur->sibling; + if (cur->sibling == xml) { // first of a sibling list + cur->sibling = (xml->next) ? xml->next +@@ -1051,8 +1051,9 @@ ezxml_t ezxml_cut(ezxml_t xml) + else cur = cur->sibling; // not first of a sibling list + } + +- while (cur->next && cur->next != xml) cur = cur->next; +- if (cur->next) cur->next = cur->next->next; // patch next list ++ cur = xml->parent->child; // go back to head of subtag list ++ while (cur && cur->next != xml) cur = cur->ordered; ++ if (cur && cur->next) cur->next = cur->next->next; // patch next list + } + } + xml->ordered = xml->sibling = xml->next = NULL; -- 2.11.0