summaryrefslogtreecommitdiff
path: root/sys/src/cmd/uhtml.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@centraldogma>2011-09-20 04:14:29 +0200
committercinap_lenrek <cinap_lenrek@centraldogma>2011-09-20 04:14:29 +0200
commit6c91d99ce29f8cb6c47c0c535c9162f248f1fdb1 (patch)
tree63ef4ea08cd0e5a2a23edf9c44de52d1d5bcc7df /sys/src/cmd/uhtml.c
parent7a29aa57cbc0a5ccf015ded763b54046235275ec (diff)
uhtml: remove trailing utf BOM marker, html2ms: fix underline handling and escaping
Diffstat (limited to 'sys/src/cmd/uhtml.c')
-rw-r--r--sys/src/cmd/uhtml.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/src/cmd/uhtml.c b/sys/src/cmd/uhtml.c
index 49503877e..c18c76202 100644
--- a/sys/src/cmd/uhtml.c
+++ b/sys/src/cmd/uhtml.c
@@ -62,6 +62,11 @@ main(int argc, char *argv[])
if((nbuf = read(0, buf, sizeof(buf)-1)) < 0)
sysfatal("read: %r");
buf[nbuf] = 0;
+
+ /* useless BOM marker */
+ if(memcmp(buf, "\xEF\xBB\xBF", 3)==0)
+ memmove(buf, buf+3, nbuf-3);
+
for(;;){
if(s = cistrstr(buf, "encoding="))
if(s = strval(s+9)){