diff options
author | cinap_lenrek <cinap_lenrek@centraldogma> | 2011-09-17 12:21:24 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@centraldogma> | 2011-09-17 12:21:24 +0200 |
commit | 35fcb73f86518e00fb002c98d0d0a39eef9209fa (patch) | |
tree | 4d71af393eee8c060d6ca45d6d0119f026d71acb | |
parent | 6bf47606dec88a77390df6dae6ab27f9533cf0a1 (diff) |
page: generalize html support
-rw-r--r-- | sys/src/cmd/page.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/src/cmd/page.c b/sys/src/cmd/page.c index a3ab0d820..298ebacd7 100644 --- a/sys/src/cmd/page.c +++ b/sys/src/cmd/page.c @@ -148,7 +148,7 @@ createtmp(ulong id, char *pfx) { char nam[64]; - snprint(nam, sizeof nam, "%s%s%.12d%.8lux", pagespool, pfx, getpid(), id ^ 0xcafebabe); + snprint(nam, sizeof nam, "%s%s%.12d%.8lux", pagespool, pfx, getpid(), id); return create(nam, OEXCL|ORCLOSE|ORDWR, 0600); } @@ -323,10 +323,10 @@ popenepub(Page *p) addpage(p, shortname(buf), popenfile, strdup(buf), -1); } close(fd); + p->text = strdup(p->label); return -1; } - typedef struct Ghost Ghost; struct Ghost { @@ -623,7 +623,9 @@ popenfile(Page *p) p->data = "lp -dstdout"; p->open = popengs; } - else if(memcmp(buf, "<?xml", 5) == 0){ + else if(cistrncmp(buf, "<?xml", 5) == 0 || + cistrncmp(buf, "<!DOCTYPE", 9) == 0 || + cistrncmp(buf, "<HTML", 5) == 0){ p->data = "htmlfmt -c utf8 | lp -dstdout"; p->open = popengs; } |