With the change to always position the cursor at the end of the exsisting text on entering the textentry field edit state it became necessary to avoid initializing textentry fields with blanks insteads of zeros.

Unfortunately I overlooked the dynamically created textentry fields for web forms. Changing their behaviour was a little more complicated as the length of the existing text was used to determine the size of the textentry field. Now this size is passed explicitly.

Fortunately this saves again ~100 bytes on cc65 targets :-)
diff --git a/contiki/apps/htmlparser.c b/contiki/apps/htmlparser.c
index 18541f6..1102e6b 100644
--- a/contiki/apps/htmlparser.c
+++ b/contiki/apps/htmlparser.c
@@ -29,7 +29,7 @@
  *
  * This file is part of the Contiki desktop environment 
  *
- * $Id: htmlparser.c,v 1.10 2005/05/20 21:53:21 oliverschmidt Exp $
+ * $Id: htmlparser.c,v 1.11 2005/06/12 23:44:29 oliverschmidt Exp $
  *
  */
 
@@ -359,7 +359,7 @@
 parse_tag(void)
 {
   static char *tagattrparam;
-  static unsigned char size, i;
+  static unsigned char size;
 
   static char dummy;
   
@@ -474,14 +474,8 @@
 	switch(s.inputtype) {
 	case HTMLPARSER_INPUTTYPE_NONE:
 	case HTMLPARSER_INPUTTYPE_TEXT:
-	  for(i = 0; i < s.inputvaluesize; ++i) {
-	    if(s.inputvalue[i] == 0) {
-	      memset(&s.inputvalue[i], ISO_space, s.inputvaluesize - i);
-	      s.inputvalue[s.inputvaluesize] = 0;
-	      break;
-	    }
-	  }	  
-	  htmlparser_inputfield(s.inputvalue, s.inputname,
+	  s.inputvalue[s.inputvaluesize] = 0;
+	  htmlparser_inputfield(s.inputvaluesize, s.inputvalue, s.inputname,
 				s.formname, s.formaction);
 	  break;
 	case HTMLPARSER_INPUTTYPE_SUBMIT:
diff --git a/contiki/apps/htmlparser.h b/contiki/apps/htmlparser.h
index e5e5973..ce9f7ef 100644
--- a/contiki/apps/htmlparser.h
+++ b/contiki/apps/htmlparser.h
@@ -29,7 +29,7 @@
  *
  * This file is part of the Contiki desktop environment 
  *
- * $Id: htmlparser.h,v 1.3 2004/09/03 09:55:22 adamdunkels Exp $
+ * $Id: htmlparser.h,v 1.4 2005/06/12 23:44:30 oliverschmidt Exp $
  *
  */
 #ifndef __HTMLPARSER_H__
@@ -43,7 +43,8 @@
 			     char *name,
 			     char *formname,
 			     char *formaction);
-void htmlparser_inputfield(char *value,
+void htmlparser_inputfield(unsigned char size,
+			   char *value,
 			   char *name,
 			   char *formname,
 			   char *formaction);
diff --git a/contiki/apps/www.c b/contiki/apps/www.c
index e9dd318..225f255 100644
--- a/contiki/apps/www.c
+++ b/contiki/apps/www.c
@@ -29,7 +29,7 @@
  *
  * This file is part of the Contiki desktop environment
  *
- * $Id: www.c,v 1.30 2005/04/28 21:15:44 oliverschmidt Exp $
+ * $Id: www.c,v 1.31 2005/06/12 23:44:30 oliverschmidt Exp $
  *
  */
 
@@ -895,17 +895,15 @@
     strncpy(form->inputname, name, WWW_CONF_MAX_INPUTNAMELEN);
     form->inputtype = FORMINPUTTYPE_SUBMITBUTTON;
   }
-
-
 }
 /*-----------------------------------------------------------------------------------*/
 void
-htmlparser_inputfield(char *text, char *name,
+htmlparser_inputfield(unsigned char size, char *text, char *name,
 		      char *formname, char *formaction)
 {
   register struct formattribs *form;
 
-  form = add_pagewidget(text, strlen(text), CTK_WIDGET_TEXTENTRY, 1);
+  form = add_pagewidget(text, size, CTK_WIDGET_TEXTENTRY, 1);
   if(form != NULL) {
     strncpy(form->formaction, formaction, WWW_CONF_MAX_FORMACTIONLEN);
     strncpy(form->formname, formname, WWW_CONF_MAX_FORMNAMELEN);