shithub: riscv

Download patch

ref: 3707561e047f8e7c9993e0ba5a3a3fb5b5f6a6fd
parent: 4f57de2ab8a163d8e888bec2e5179cb173a7e525
author: cinap_lenrek <[email protected]>
date: Fri Jul 20 04:56:29 EDT 2012

mothra: work arround mismatched quotes in html attributes

--- a/sys/src/cmd/mothra/rdhtml.c
+++ b/sys/src/cmd/mothra/rdhtml.c
@@ -482,12 +482,14 @@
 	pl_putback(g, c);
 	q = 0;
 	while((c=pl_nextc(g))!=EOF){
-		if(c == '\'' || c == '"'){
-			if(q == 0)
+		if(c == '=' && q == 0)
+			q = '=';
+		else if(c == '\'' || c == '"'){
+			if(q == '=')
 				q = c;
 			else if(q == c)
 				q = 0;
-		} else if(c == ETAG && q == 0)
+		} else if(c == ETAG && q != '\'' && q != '"')
 			break;
 		if(tokp < &g->token[NTOKEN-UTFmax-1])
 			tokp += lrunetochar(tokp, c);