2007-04-03 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Tue, 3 Apr 2007 07:41:06 +0000 (07:41 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Tue, 3 Apr 2007 07:41:06 +0000 (07:41 -0000)
* XmlTextReader.cs : character ']' inside DTD comment caused parser
  error. Fixed bug #81294.

* XmlTextReaderTests.cs : added test for bug #81294.

svn path=/trunk/mcs/; revision=75325

mcs/class/System.XML/System.Xml/ChangeLog
mcs/class/System.XML/System.Xml/XmlTextReader.cs
mcs/class/System.XML/Test/System.Xml/ChangeLog
mcs/class/System.XML/Test/System.Xml/XmlTextReaderTests.cs

index 4c6d37c4bc227020df8dd4941ededfe85986e0db..81780054dba2aba9e4f568092b03faa8958bbf80 100644 (file)
@@ -1,3 +1,8 @@
+2007-04-03  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * XmlTextReader.cs : character ']' inside DTD comment caused parser
+         error. Fixed bug #81294.
+
 2007-03-05  Atsushi Enomoto  <atsushi@ximian.com>
 
        * XmlReader.cs : when Create() returns customized XmlTextReader, set
index a6cb324fba94ce20220282f3dc2993a689efa6a7..8706b2637427fc2e9c3b3b59f63216fe6e42afd7 100644 (file)
@@ -2526,8 +2526,8 @@ namespace System.Xml
                                                continueParse = false;
                                                break;
                                        case DtdInputState.InsideDoubleQuoted:
-                                               continue;
                                        case DtdInputState.InsideSingleQuoted:
+                                       case DtdInputState.Comment:
                                                continue;
                                        default:
                                                throw NotWFError ("unexpected end of file at DTD.");
index 13db0be5c64f7d4aac332e30bb0b4b88788952e6..aef74a3b4a767d254a379c164c412d196f5e99bb 100644 (file)
@@ -1,3 +1,7 @@
+2007-04-03  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * XmlTextReaderTests.cs : added test for bug #81294.
+
 2007-03-05  Atsushi Enomoto  <atsushi@ximian.com>
 
        * XmlReaderSettingsTests.cs : added test for bug #81000.
index 34af76b9983dbabc7c9f2cfc016e45977c0b7fe4..d6e5a9b57b09e4fbe9c3bbf65463cd7d0ed957e7 100644 (file)
@@ -1253,5 +1253,14 @@ namespace MonoTests.System.Xml
                                                        new string (buf, 0, c));
                        AssertEquals ("total lines", 5, n);
                }
+
+               [Test] // bug #81294
+               public void DtdCommentContainsCloseBracket ()
+               {
+                       string xml = @"<!DOCTYPE kanjidic2 [<!ELEMENT kanjidic2 EMPTY> <!-- ] --> ]><kanjidic2 />";
+                       XmlTextReader xtr = new XmlTextReader (xml, XmlNodeType.Document, null);
+                       while (!xtr.EOF)
+                               xtr.Read ();
+               }
        }
 }