git: 9front

Download patch

ref: dafe8e90753770644ae0d12440584d50d5d65d85
parent: a4ab5e6fa6ac1ad7937a46213288b476879cebd4
author: stanley lieber <stanley.lieber@gmail.com>
date: Mon Oct 3 05:39:45 EDT 2011

mothra: <input type=""> default to text if no/invalid value

--- a/sys/src/cmd/mothra/forms.c
+++ b/sys/src/cmd/mothra/forms.c
@@ -169,8 +169,6 @@
 					f->name=strdup("no-name");
 			}
 		}
-		else if(cistrcmp(s, "search")==0)
-			f->type=TYPEIN;
 		else if(cistrcmp(s, "checkbox")==0)
 			f->type=CHECK;
 		else if(cistrcmp(s, "radio")==0)
@@ -188,10 +186,8 @@
 			f->type=RESET;
 		else if(cistrcmp(s, "hidden")==0)
 			f->type=HIDDEN;
-		else{
-			htmlerror(g->name, g->lineno, "bad field type %s, ignored", s);
-			break;
-		}
+		else
+			f->type=TYPEIN;
 		if((f->type==CHECK || f->type==RADIO) && !pl_hasattr(g->attr, "value")){
 			free(f->value);
 			f->value=strdup("on");
--