found another bug while looking at #309616 on missing entities. this

* parser.c: found another bug while looking at #309616 on missing
  entities.
* result/ent2.sax* result/ent7.sax* result/xml2.sax*: this changed the
  SAX stream in missing conditions for a few tests
Daniel
diff --git a/ChangeLog b/ChangeLog
index a1d230e..b024bf2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Wed Aug 24 16:44:41 CEST 2005 Daniel Veillard <daniel@veillard.com>
+
+	* parser.c: found another bug while looking at #309616 on missing
+	  entities.
+	* result/ent2.sax* result/ent7.sax* result/xml2.sax*: this changed the
+	  SAX stream in missing conditions for a few tests
+
 Wed Aug 24 16:19:00 CEST 2005 Daniel Veillard <daniel@veillard.com>
 
 	* encoding.c: applied the patch suggested #309565 which can avoid
diff --git a/parser.c b/parser.c
index 3d810f0..44e6180 100644
--- a/parser.c
+++ b/parser.c
@@ -6100,6 +6100,11 @@
 		    } else {
 		        xmlErrMsgStr(ctxt, XML_WAR_UNDECLARED_ENTITY,
 				 "Entity '%s' not defined\n", name);
+			if ((ctxt->inSubset == 0) &&
+		            (ctxt->sax != NULL) &&
+		            (ctxt->sax->reference != NULL)) {
+			    ctxt->sax->reference(ctxt, name);
+			}
 		    }
 		    ctxt->valid = 0;
 		}
diff --git a/result/ent2.sax b/result/ent2.sax
index 382bac1..07d2ce4 100644
--- a/result/ent2.sax
+++ b/result/ent2.sax
@@ -11,6 +11,7 @@
   , 3)
 SAX.getEntity(title)
 SAX.error: Entity 'title' not defined
+SAX.reference(title)
 SAX.characters(
   This text is about XML, the, 31)
 SAX.getEntity(xml)
diff --git a/result/ent2.sax2 b/result/ent2.sax2
index 8c28ea9..d7c8002 100644
--- a/result/ent2.sax2
+++ b/result/ent2.sax2
@@ -11,6 +11,7 @@
   , 3)
 SAX.getEntity(title)
 SAX.error: Entity 'title' not defined
+SAX.reference(title)
 SAX.characters(
   This text is about XML, the, 31)
 SAX.getEntity(xml)
diff --git a/result/ent7.sax b/result/ent7.sax
index 0d5befa..3228de3 100644
--- a/result/ent7.sax
+++ b/result/ent7.sax
@@ -11,6 +11,7 @@
 SAX.characters('they called me , 16)
 SAX.getEntity(sampleEnt)
 SAX.error: Entity 'sampleEnt' not defined
+SAX.reference(sampleEnt)
 SAX.characters(', 1)
 SAX.endDocument()
 xmlSAXUserParseFile returned error 27
diff --git a/result/ent7.sax2 b/result/ent7.sax2
index 0d5befa..3228de3 100644
--- a/result/ent7.sax2
+++ b/result/ent7.sax2
@@ -11,6 +11,7 @@
 SAX.characters('they called me , 16)
 SAX.getEntity(sampleEnt)
 SAX.error: Entity 'sampleEnt' not defined
+SAX.reference(sampleEnt)
 SAX.characters(', 1)
 SAX.endDocument()
 xmlSAXUserParseFile returned error 27
diff --git a/result/xml2.sax b/result/xml2.sax
index e848473..141accd 100644
--- a/result/xml2.sax
+++ b/result/xml2.sax
@@ -12,6 +12,7 @@
 SAX.characters(This sample shows a , 20)
 SAX.getEntity(tricky)
 SAX.error: Entity 'tricky' not defined
+SAX.reference(tricky)
 SAX.characters( method., 8)
 SAX.endDocument()
 xmlSAXUserParseFile returned error 27
diff --git a/result/xml2.sax2 b/result/xml2.sax2
index e848473..141accd 100644
--- a/result/xml2.sax2
+++ b/result/xml2.sax2
@@ -12,6 +12,7 @@
 SAX.characters(This sample shows a , 20)
 SAX.getEntity(tricky)
 SAX.error: Entity 'tricky' not defined
+SAX.reference(tricky)
 SAX.characters( method., 8)
 SAX.endDocument()
 xmlSAXUserParseFile returned error 27