[Mono-dev] [Mono-patches] r73587 -trunk/mcs/class/System.Web/System.Web.Compilation

Igor Zelmanovich igorz at mainsoft.com
Tue Mar 6 09:41:29 EST 2007


This patch causes 3 regressions in tests
(System.Web.UI.WebControls.XmlDataSource.cs).

Please fix or revert.

-----Original Message-----
From: mono-patches-bounces at lists.ximian.com
[mailto:mono-patches-bounces at lists.ximian.com] On Behalf Of Marek
Habersack (grendello at gmail.com)
Sent: Thursday, March 01, 2007 3:57 PM
To: mono-patches at lists.ximian.com; ximian.monolist at gmail.com;
mono-svn-patches-garchive-20758 at googlegroups.com
Subject: [Mono-patches] r73587
-trunk/mcs/class/System.Web/System.Web.Compilation

Author: mhabersack
Date: 2007-03-01 08:57:18 -0500 (Thu, 01 Mar 2007)
New Revision: 73587

Modified:
   trunk/mcs/class/System.Web/System.Web.Compilation/AspParser.cs
   trunk/mcs/class/System.Web/System.Web.Compilation/ChangeLog
Log:
Fix for the asp parser

Modified: trunk/mcs/class/System.Web/System.Web.Compilation/AspParser.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.Compilation/AspParser.cs
2007-03-01 13:08:04 UTC (rev 73586)
+++ trunk/mcs/class/System.Web/System.Web.Compilation/AspParser.cs
2007-03-01 13:57:18 UTC (rev 73587)
@@ -362,39 +362,41 @@
 		}
 
 		string GetVerbatim (int token, string end)
-		{
-			StringBuilder vb_text = new StringBuilder ();
-			int i = 0;
+                {
+                        StringBuilder vb_text = new StringBuilder ();
+                        int i = 0, i2 = 0;
 
-			if (tokenizer.Value.Length > 1){
-				// May be we have a put_back token that
is not a single character
-				vb_text.Append (tokenizer.Value);
-				token = tokenizer.get_token ();
-			}
+                        if (tokenizer.Value.Length > 1){
+                                // May be we have a put_back token that
is not a single character
+                                vb_text.Append (tokenizer.Value);
+                                token = tokenizer.get_token ();
+                        }
 
-			end = end.ToLower
(CultureInfo.InvariantCulture);
-			while (token != Token.EOF){
-				if (Char.ToLower ((char) token,
CultureInfo.InvariantCulture) == end [i]){
-					if (++i >= end.Length)
-						break;
-					token = tokenizer.get_token ();
-					continue;
-				} else if (i > 0) {
-					for (int j = 0; j < i; j++)
-						vb_text.Append (end
[j]);
-					i = 0;
-				}
+                        end = end.ToLower
(CultureInfo.InvariantCulture);
+                        while (token != Token.EOF){
+                                if (Char.ToLower ((char) token,
CultureInfo.InvariantCulture) == end [i]){
+                                        i2++;
+                                        if (++i >= end.Length)
+                                                break;
+                                        token = tokenizer.get_token ();
+                                        continue;
+                                } else if (i > 0) {
+                                        if (i > 1)
+                                                i2 -= i;
+                                        for (int j = 0; j < i2; j++)
+                                                vb_text.Append (end
[j]);
+                                        i2 = 0;
+                                }
+                                vb_text.Append ((char) token);
+                                token = tokenizer.get_token ();
+                        } 
 
-				vb_text.Append ((char) token);
-				token = tokenizer.get_token ();
-			} 
+                        if (token == Token.EOF)
+                                OnError ("Expecting " + end + " and got
EOF.");
 
-			if (token == Token.EOF)
-				OnError ("Expecting " + end + " and got
EOF.");
+                        return RemoveComments (vb_text.ToString ());
+                }
 
-			return RemoveComments (vb_text.ToString ());
-		}
-
 		string RemoveComments (string text)
 		{
 			int end;

Modified: trunk/mcs/class/System.Web/System.Web.Compilation/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.Compilation/ChangeLog
2007-03-01 13:08:04 UTC (rev 73586)
+++ trunk/mcs/class/System.Web/System.Web.Compilation/ChangeLog
2007-03-01 13:57:18 UTC (rev 73587)
@@ -1,3 +1,10 @@
+2007-03-01  Marek Habersack  <grendello at gmail.com>
+
+	* AspParser.cs: fix GetVerbatim for cases when the end is
+	e.g. --> or --%> and the string matched is ---> or ---%>
+	respectively. The new code always backs out to make sure the end
is
+	matched correctly.
+
 2007-02-27  Marek Habersack  <grendello at gmail.com>
 
 	* TemplateControlCompiler.cs: ParseExpression returns an object,

_______________________________________________
Mono-patches maillist  -  Mono-patches at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-patches



More information about the Mono-devel-list mailing list