git: 9front

Download patch

ref: ea0d0f295f646e18ab39d64ff439c756eae546eb
parent: 166cba6ec4713713d9ff1d8b4c175ddae9363f91
author: stanley lieber <stanley.lieber@gmail.com>
date: Mon Oct 3 16:27:59 EDT 2011

mothra: interpret files beggining with <head> as html; include <html> tag in newly created hit.html files

--- a/sys/src/cmd/mothra/mothra.c
+++ b/sys/src/cmd/mothra/mothra.c
@@ -1103,7 +1103,7 @@
 				message("can't open %s", name);
 				return;
 			}
-			fprint(fd, "<head><title>Hit List</title></head>\n");
+			fprint(fd, "<html><head><title>Hit List</title></head>\n");
 			fprint(fd, "<body><h1>Hit list</h1>\n");
 		}
 		seek(fd, 0, 2);
--- a/sys/src/cmd/mothra/snoop.c
+++ b/sys/src/cmd/mothra/snoop.c
@@ -18,7 +18,8 @@
 	buf[n] = 0;
 	if(cistrstr(buf, "<?xml") ||
 		cistrstr(buf, "<!DOCTYPE") ||
-		cistrstr(buf, "<HTML"))
+		cistrstr(buf, "<HTML") ||
+		cistrstr(buf, "<head"))
 		typ = HTML;
 	else if(memcmp(buf, "\x1F\x8B", 2) == 0)
 		typ = GUNZIP;
--