Changed the maximum length of a single word from 40 to match the page width. Browsers wider than 40 cols can now render longer words. Browsers smaller than 40 cols avoid display inconsistencies on long words (and save memory). Additionally simplified word truncation code.
diff --git a/contiki/apps/htmlparser.c b/contiki/apps/htmlparser.c
index efbfb9b..af1938e 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.7 2004/09/03 09:55:22 adamdunkels Exp $
+ * $Id: htmlparser.c,v 1.8 2005/05/20 20:49:30 oliverschmidt Exp $
  *
  */
 
@@ -156,10 +156,8 @@
   unsigned char majorstate, lastmajorstate;
   char linkurl[WWW_CONF_MAX_URLLEN];
 
-#define MAX_WORDLEN 40
-  char word[MAX_WORDLEN];
-  unsigned char wordlen;
-  
+  char word[WWW_CONF_WEBPAGE_WIDTH];
+  unsigned char wordlen;  
   
 #if WWW_CONF_FORMS
   char formaction[WWW_CONF_MAX_FORMACTIONLEN];
@@ -284,13 +282,9 @@
 static void CC_FASTCALL
 add_char(unsigned char c)
 {
-  if(s.wordlen < MAX_WORDLEN &&
-     c < 0x80) {
+  if(s.wordlen < WWW_CONF_WEBPAGE_WIDTH - 1 && c < 0x80) {
     s.word[s.wordlen] = c;
     ++s.wordlen;
-    if(s.wordlen == MAX_WORDLEN) {
-      s.wordlen = MAX_WORDLEN - 1;
-    }
   }
 }
 /*-----------------------------------------------------------------------------------*/