fix a bug introduced when fixing #438208 and reported by Ashwin fix an

* tree.c: fix a bug introduced when fixing #438208 and reported by
  Ashwin
* python/generator.py: fix an infinite loop bug
Daniel

svn path=/trunk/; revision=3733
diff --git a/ChangeLog b/ChangeLog
index 576939f..4da35e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Apr  8 10:19:01 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+	* tree.c: fix a bug introduced when fixing #438208 and reported by
+	  Ashwin
+	* python/generator.py: fix an infinite loop bug
+
 Mon Apr  7 14:44:51 CEST 2008 Daniel Veillard <daniel@veillard.com>
 
 	* xmlreader.c: fix a link to XmlNodeType doc reported by Martijn Arts
diff --git a/python/generator.py b/python/generator.py
index a38a23c..8cf327b 100755
--- a/python/generator.py
+++ b/python/generator.py
@@ -849,6 +849,9 @@
      output.write(indent)
      output.write('"""')
      while len(val) > 60:
+         if val[0] == " ":
+	     val = val[1:]
+	     continue
          str = val[0:60]
          i = string.rfind(str, " ");
          if i < 0:
diff --git a/tree.c b/tree.c
index 3b7d25d..763381b 100644
--- a/tree.c
+++ b/tree.c
@@ -1785,7 +1785,7 @@
     if ((node != NULL) && (node->type != XML_ELEMENT_NODE)) {
         if ((eatname == 1) &&
 	    ((node->doc == NULL) ||
-	     (!(xmlDictOwns(node->doc->dict, name) == 0))))
+	     (!(xmlDictOwns(node->doc->dict, name)))))
             xmlFree((xmlChar *) name);
         return (NULL);
     }
@@ -1797,7 +1797,7 @@
     if (cur == NULL) {
         if ((eatname == 1) &&
 	    ((node->doc == NULL) ||
-	     (!(xmlDictOwns(node->doc->dict, name) == 0))))
+	     (!(xmlDictOwns(node->doc->dict, name)))))
             xmlFree((xmlChar *) name);
         xmlTreeErrMemory("building attribute");
         return (NULL);