git: 9front

Download patch

ref: e1581c45eeaec836b6f4a166f2b14e1171c2ee5d
parent: be594494795ae930091d3566f9166479504b1884
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Sun Jun 16 18:43:09 EDT 2013

abaco: allow single quotes for ctype attribute (thanks plhk)

plhk9 → abaco: charset 'utf-8'> not supported
plhk9 → http://plhk.ru/trash/abaco-singlequote.diff makes it go away

--- a/sys/src/cmd/abaco/util.c
+++ b/sys/src/cmd/abaco/util.c
@@ -866,7 +866,7 @@
 int
 findctype(char *b, int l, char *keyword, char *s)
 {
-	char *p, *e;
+	char *p, *e, c;
 	int i;
 
 	p = cistrstr(s, keyword);
@@ -882,14 +882,18 @@
 		p++;
 	if(!*p)
 		return -1;
-	if(*p == '"'){
+	switch (c = *p){
+	case '"':
+	case '\'':
 		p++;
-		e = strchr(p, '"');
+		e = strchr(p, c);
 		if(!e)
 			return -1;
-	}else
+		break;
+	default:
 		for(e = p; *e < 127 && *e > ' ' ; e++)
 			;
+	}
 	i = e-p;
 	if(i < 1)
 		return -1;
--