From d0716fd0a751c3b85301b9cfc088f20a30b0cef5 Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Mon, 27 Sep 2010 11:45:06 +0200 Subject: [PATCH] luaxml: added patch to fix handling of empty attributes --- lua/luaxml/empty_attributes.patch | 37 +++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 lua/luaxml/empty_attributes.patch diff --git a/lua/luaxml/empty_attributes.patch b/lua/luaxml/empty_attributes.patch new file mode 100644 index 000000000..1bc1777fb --- /dev/null +++ b/lua/luaxml/empty_attributes.patch @@ -0,0 +1,37 @@ +# --- SDE-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# Filename: package/.../luaxml/empty_attributes.patch +# Copyright (C) 2010 The OpenSDE Project +# +# More information can be found in the files COPYING and README. +# +# This patch file is dual-licensed. It is available under the license the +# patched project is licensed under, as long as it is an OpenSource license +# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms +# of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# --- SDE-COPYRIGHT-NOTE-END --- + +From: 张增波 +Date: 2010/9/25 +Subject: [patch] LuaXml can't interpret empty attribute +To: gerald.franz@viremo.de + +--- ./LuaXML_lib_unix.c 2010-09-25 15:10:19.000000000 +0800 ++++ ./LuaXML_lib.c 2010-09-25 15:04:26.000000000 +0800 +@@ -319,7 +319,12 @@ + if(token[sepPos]) { // regular attribute + const char* aVal =token+sepPos+2; + lua_pushlstring(L, token, sepPos); +- Xml_pushDecode(L, aVal, strlen(aVal)-1); ++ if ( strlen(aVal) == 1 ) { ++ Xml_pushDecode(L, "", 0); ++ } ++ else{ ++ Xml_pushDecode(L, aVal, strlen(aVal)-1); ++ } + lua_settable(L, -3); + } + }