This is the corrected version of my patch.
Removed unused char*, other minor corrections.
Best Regards,
--
Olo
GG#: 274614
ICQ UIN: 19780575
http://olo.office.altkom.com.pl
diff -urN jud-0.4/jud_search.c jud-0.4.olo/jud_search.c
--- jud-0.4/jud_search.c Thu Feb 1 10:46:54 2001
+++ jud-0.4.olo/jud_search.c Mon Dec 9 18:09:18 2002
@@ -39,6 +39,7 @@
int flag_searched = 0;
int flag_mismatch = 0;
char *data;
+ char *normalizeddata;
for(term = xmlnode_get_firstchild(p->iq); term != NULL; term =
xmlnode_get_nextsibling(term))
{
@@ -46,7 +47,26 @@
flag_searched = 1;
-
if(j_strncasecmp(data,xmlnode_get_tag_data(cur,xmlnode_get_name(term)),strlen(data))
!= 0)
+ /*
+ * by Aleksander Adamowski <[EMAIL PROTECTED]>:
+ * Strip initial whitespace characters to workaround
+ * a bug in XML parser where empty elements
+ * on a line with initial whitespaces would
+ * receive those whitespaces in their content
+ */
+ for (normalizeddata = data;
+ *normalizeddata != '\0' &&
+ (*normalizeddata == '\t' ||
+ *normalizeddata == '\n' ||
+ *normalizeddata == ' ')
+ ;
+ normalizeddata++)
+ ;
+ data = normalizeddata;
+
+ if( (strlen(data) > 0) &&
+
+(j_strncasecmp(data,xmlnode_get_tag_data(cur,xmlnode_get_name(term)),strlen(data)) !=
+0)
+ )
flag_mismatch = 1;
}