fixed a serious problem when substituing entities using the Reader, the

* parser.c xmlreader.c include/libxml/parser.h: fixed a serious
  problem when substituing entities using the Reader, the entities
  content might be freed and if rereferenced would crash
* Makefile.am test/* result/*: added a new test case and a new
  test operation for the reader with substitution of entities.
Daniel
diff --git a/result/dia2.rde b/result/dia2.rde
new file mode 100644
index 0000000..3767325
--- /dev/null
+++ b/result/dia2.rde
@@ -0,0 +1,292 @@
+0 1 dia:diagram 0 0
+1 14 #text 0 1 
+  
+1 1 dia:diagramdata 0 0
+2 14 #text 0 1 
+    
+2 1 dia:attribute 0 0
+3 14 #text 0 1 
+      
+3 1 dia:color 1 0
+3 14 #text 0 1 
+    
+2 15 dia:attribute 0 0
+2 14 #text 0 1 
+  
+1 15 dia:diagramdata 0 0
+1 14 #text 0 1 
+  
+1 1 dia:layer 0 0
+2 14 #text 0 1 
+    
+2 1 dia:object 0 0
+3 14 #text 0 1 
+      
+3 1 dia:attribute 0 0
+4 14 #text 0 1 
+        
+4 1 dia:point 1 0
+4 14 #text 0 1 
+      
+3 15 dia:attribute 0 0
+3 14 #text 0 1 
+      
+3 1 dia:attribute 0 0
+4 14 #text 0 1 
+        
+4 1 dia:rectangle 1 0
+4 14 #text 0 1 
+      
+3 15 dia:attribute 0 0
+3 14 #text 0 1 
+      
+3 1 dia:attribute 0 0
+4 14 #text 0 1 
+        
+4 1 dia:point 1 0
+4 14 #text 0 1 
+        
+4 1 dia:point 1 0
+4 14 #text 0 1 
+      
+3 15 dia:attribute 0 0
+3 14 #text 0 1 
+      
+3 1 dia:attribute 0 0
+4 14 #text 0 1 
+        
+4 1 dia:color 1 0
+4 14 #text 0 1 
+      
+3 15 dia:attribute 0 0
+3 14 #text 0 1 
+      
+3 1 dia:attribute 0 0
+4 14 #text 0 1 
+        
+4 1 dia:real 1 0
+4 14 #text 0 1 
+      
+3 15 dia:attribute 0 0
+3 14 #text 0 1 
+      
+3 1 dia:attribute 0 0
+4 14 #text 0 1 
+        
+4 1 dia:enum 1 0
+4 14 #text 0 1 
+      
+3 15 dia:attribute 0 0
+3 14 #text 0 1 
+      
+3 1 dia:attribute 0 0
+4 14 #text 0 1 
+        
+4 1 dia:enum 1 0
+4 14 #text 0 1 
+      
+3 15 dia:attribute 0 0
+3 14 #text 0 1 
+      
+3 1 dia:attribute 0 0
+4 14 #text 0 1 
+        
+4 1 dia:enum 1 0
+4 14 #text 0 1 
+      
+3 15 dia:attribute 0 0
+3 14 #text 0 1 
+      
+3 1 dia:connections 0 0
+4 14 #text 0 1 
+        
+4 1 dia:connection 1 0
+4 14 #text 0 1 
+      
+3 15 dia:connections 0 0
+3 14 #text 0 1 
+    
+2 15 dia:object 0 0
+2 14 #text 0 1 
+    
+2 1 dia:object 0 0
+3 14 #text 0 1 
+      
+3 1 dia:attribute 0 0
+4 14 #text 0 1 
+        
+4 1 dia:point 1 0
+4 14 #text 0 1 
+      
+3 15 dia:attribute 0 0
+3 14 #text 0 1 
+      
+3 1 dia:attribute 0 0
+4 14 #text 0 1 
+        
+4 1 dia:rectangle 1 0
+4 14 #text 0 1 
+      
+3 15 dia:attribute 0 0
+3 14 #text 0 1 
+      
+3 1 dia:attribute 0 0
+4 14 #text 0 1 
+        
+4 1 dia:composite 0 0
+5 14 #text 0 1 
+          
+5 1 dia:attribute 0 0
+6 14 #text 0 1 
+            
+6 1 dia:string 1 0
+6 14 #text 0 1 
+          
+5 15 dia:attribute 0 0
+5 14 #text 0 1 
+          
+5 1 dia:attribute 0 0
+6 14 #text 0 1 
+            
+6 1 dia:font 1 0
+6 14 #text 0 1 
+          
+5 15 dia:attribute 0 0
+5 14 #text 0 1 
+          
+5 1 dia:attribute 0 0
+6 14 #text 0 1 
+            
+6 1 dia:real 1 0
+6 14 #text 0 1 
+          
+5 15 dia:attribute 0 0
+5 14 #text 0 1 
+          
+5 1 dia:attribute 0 0
+6 14 #text 0 1 
+            
+6 1 dia:point 1 0
+6 14 #text 0 1 
+          
+5 15 dia:attribute 0 0
+5 14 #text 0 1 
+          
+5 1 dia:attribute 0 0
+6 14 #text 0 1 
+            
+6 1 dia:color 1 0
+6 14 #text 0 1 
+          
+5 15 dia:attribute 0 0
+5 14 #text 0 1 
+          
+5 1 dia:attribute 0 0
+6 14 #text 0 1 
+            
+6 1 dia:enum 1 0
+6 14 #text 0 1 
+          
+5 15 dia:attribute 0 0
+5 14 #text 0 1 
+        
+4 15 dia:composite 0 0
+4 14 #text 0 1 
+      
+3 15 dia:attribute 0 0
+3 14 #text 0 1 
+    
+2 15 dia:object 0 0
+2 14 #text 0 1 
+    
+2 1 dia:object 0 0
+3 14 #text 0 1 
+      
+3 1 dia:attribute 0 0
+4 14 #text 0 1 
+        
+4 1 dia:point 1 0
+4 14 #text 0 1 
+      
+3 15 dia:attribute 0 0
+3 14 #text 0 1 
+      
+3 1 dia:attribute 0 0
+4 14 #text 0 1 
+        
+4 1 dia:rectangle 1 0
+4 14 #text 0 1 
+      
+3 15 dia:attribute 0 0
+3 14 #text 0 1 
+      
+3 1 dia:attribute 0 0
+4 14 #text 0 1 
+        
+4 1 dia:point 1 0
+4 14 #text 0 1 
+      
+3 15 dia:attribute 0 0
+3 14 #text 0 1 
+      
+3 1 dia:attribute 0 0
+4 14 #text 0 1 
+        
+4 1 dia:real 1 0
+4 14 #text 0 1 
+      
+3 15 dia:attribute 0 0
+3 14 #text 0 1 
+      
+3 1 dia:attribute 0 0
+4 14 #text 0 1 
+        
+4 1 dia:real 1 0
+4 14 #text 0 1 
+      
+3 15 dia:attribute 0 0
+3 14 #text 0 1 
+      
+3 1 dia:attribute 0 0
+4 14 #text 0 1 
+        
+4 1 dia:real 1 0
+4 14 #text 0 1 
+      
+3 15 dia:attribute 0 0
+3 14 #text 0 1 
+      
+3 1 dia:attribute 0 0
+4 14 #text 0 1 
+        
+4 1 dia:color 1 0
+4 14 #text 0 1 
+      
+3 15 dia:attribute 0 0
+3 14 #text 0 1 
+      
+3 1 dia:attribute 0 0
+4 14 #text 0 1 
+        
+4 1 dia:color 1 0
+4 14 #text 0 1 
+      
+3 15 dia:attribute 0 0
+3 14 #text 0 1 
+      
+3 1 dia:attribute 0 0
+4 14 #text 0 1 
+        
+4 1 dia:enum 1 0
+4 14 #text 0 1 
+      
+3 15 dia:attribute 0 0
+3 14 #text 0 1 
+    
+2 15 dia:object 0 0
+2 14 #text 0 1 
+  
+1 15 dia:layer 0 0
+1 14 #text 0 1 
+
+0 15 dia:diagram 0 0