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

This commit is contained in:
stanley lieber 2011-10-03 20:27:59 -05:00
parent fce88957a4
commit eff23cb32e
2 changed files with 3 additions and 2 deletions

View file

@ -1103,7 +1103,7 @@ void hit3(int button, int item){
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);

View file

@ -18,7 +18,8 @@ snooptype(int fd)
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;