From: Florian Fainelli Date: Sat, 29 Nov 2008 15:24:51 +0000 (+0000) Subject: Add patches from #4265: - patch to fix compilation warnings - patch to fix content... X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=97502e1189098a3e7be0d9c212f6222f52fa7d12;p=openwrt%2Fsvn-archive%2Fpackages.git Add patches from #4265: - patch to fix compilation warnings - patch to fix content type issue (causing problems with firefox 3) - patch to add XRequestedWith and XRequestedHandler HTTP headers SVN-Revision: 13430 --- diff --git a/libs/clearsilver/patches/100-remove_warnings.patch b/libs/clearsilver/patches/100-remove_warnings.patch new file mode 100644 index 000000000..747c0e96e --- /dev/null +++ b/libs/clearsilver/patches/100-remove_warnings.patch @@ -0,0 +1,708 @@ +diff -pruN clearsilver-0.10.5.orig/cgi/cgi.c clearsilver-0.10.5/cgi/cgi.c +--- clearsilver-0.10.5.orig/cgi/cgi.c 2007-07-12 04:38:03.000000000 +0200 ++++ clearsilver-0.10.5/cgi/cgi.c 2008-01-28 12:04:50.000000000 +0100 +@@ -698,7 +700,7 @@ NEOERR *cgi_parse (CGI *cgi) + x = 0; + while (x < len) + { +- if (len-x > sizeof(buf)) ++ if (len-x > (int) sizeof(buf)) + cgiwrap_read (buf, sizeof(buf), &r); + else + cgiwrap_read (buf, len - x, &r); +@@ -1363,6 +1365,8 @@ void cgi_neo_error (CGI *cgi, NEOERR *er + { + STRING str; + ++ UNUSED(cgi); ++ + string_init(&str); + cgiwrap_writef("Status: 500\n"); + cgiwrap_writef("Content-Type: text/html\n\n"); +@@ -1377,6 +1381,8 @@ void cgi_error (CGI *cgi, const char *fm + { + va_list ap; + ++ UNUSED(cgi); ++ + cgiwrap_writef("Status: 500\n"); + cgiwrap_writef("Content-Type: text/html\n\n"); + cgiwrap_writef("\nAn error occured:
");
+@@ -1536,6 +1542,8 @@ NEOERR *cgi_cookie_set (CGI *cgi, const 
+   STRING str;
+   char my_time[256];
+ 
++  UNUSED(cgi);
++
+   if (path == NULL) path = "/";
+ 
+   string_init(&str);
+@@ -1584,6 +1592,8 @@ NEOERR *cgi_cookie_set (CGI *cgi, const 
+ NEOERR *cgi_cookie_clear (CGI *cgi, const char *name, const char *domain,
+                           const char *path)
+ {
++  UNUSED(cgi);
++
+   if (path == NULL) path = "/";
+   if (domain)
+   {
+diff -pruN clearsilver-0.10.5.orig/cgi/cgiwrap.c clearsilver-0.10.5/cgi/cgiwrap.c
+--- clearsilver-0.10.5.orig/cgi/cgiwrap.c	2006-12-19 05:36:20.000000000 +0100
++++ clearsilver-0.10.5/cgi/cgiwrap.c	2008-01-28 12:02:32.000000000 +0100
+@@ -14,6 +14,9 @@
+ #if HAVE_FEATURES_H
+ #include 
+ #endif
++#ifdef __UCLIBC__
++#include 
++#endif
+ #include 
+ #include 
+ #include 
+diff -pruN clearsilver-0.10.5.orig/cgi/date.c clearsilver-0.10.5/cgi/date.c
+--- clearsilver-0.10.5.orig/cgi/date.c	2006-11-03 17:56:22.000000000 +0100
++++ clearsilver-0.10.5/cgi/date.c	2008-01-28 12:01:53.000000000 +0100
+@@ -94,7 +94,7 @@ NEOERR *export_date_tm (HDF *data, const
+   if (err) return nerr_pass(err);
+   err = hdf_set_int_value (obj, "wday", ttm->tm_wday);
+   if (err) return nerr_pass(err);
+-  // neo_tz_offset() returns offset from GMT in seconds
++  /* neo_tz_offset() returns offset from GMT in seconds */
+   tzoffset_seconds = neo_tz_offset(ttm);
+   tzoffset = tzoffset_seconds / 60;
+   if (tzoffset < 0)
+@@ -109,12 +109,12 @@ NEOERR *export_date_tm (HDF *data, const
+   return STATUS_OK;
+ }
+ 
+-NEOERR *export_date_time_t (HDF *data, const char *prefix, const char *timezone,
++NEOERR *export_date_time_t (HDF *data, const char *prefix, const char *tz,
+                             time_t tt)
+ {
+   struct tm ttm;
+ 
+-  neo_time_expand (tt, timezone, &ttm);
++  neo_time_expand (tt, tz, &ttm);
+   return nerr_pass (export_date_tm (data, prefix, &ttm));
+ }
+ 
+diff -pruN clearsilver-0.10.5.orig/cgi/date.h clearsilver-0.10.5/cgi/date.h
+--- clearsilver-0.10.5.orig/cgi/date.h	2005-07-01 03:21:30.000000000 +0200
++++ clearsilver-0.10.5/cgi/date.h	2008-01-28 11:36:10.000000000 +0100
+@@ -17,7 +17,7 @@
+ __BEGIN_DECLS
+ 
+ NEOERR *export_date_tm (HDF *obj, const char *prefix, struct tm *ttm);
+-NEOERR *export_date_time_t (HDF *obj, const char *prefix, const char *timezone, 
++NEOERR *export_date_time_t (HDF *obj, const char *prefix, const char *tz,
+                             time_t tt);
+ 
+ __END_DECLS
+diff -pruN clearsilver-0.10.5.orig/cgi/html.c clearsilver-0.10.5/cgi/html.c
+--- clearsilver-0.10.5.orig/cgi/html.c	2006-10-20 01:26:35.000000000 +0200
++++ clearsilver-0.10.5/cgi/html.c	2008-01-28 11:36:10.000000000 +0100
+@@ -774,7 +774,7 @@ NEOERR *html_strip_alloc(const char *src
+ 	}
+ 	else
+ 	{
+-	  if (ampl < sizeof(amp)-1)
++	  if (ampl < (int) sizeof(amp)-1)
+ 	    amp[ampl++] = tolower(src[x]);
+ 	  else
+ 	  {
+diff -pruN clearsilver-0.10.5.orig/cgi/rfc2388.c clearsilver-0.10.5/cgi/rfc2388.c
+--- clearsilver-0.10.5.orig/cgi/rfc2388.c	2006-08-29 10:44:50.000000000 +0200
++++ clearsilver-0.10.5/cgi/rfc2388.c	2008-01-28 12:01:13.000000000 +0100
+@@ -155,14 +155,14 @@ static NEOERR * _read_line (CGI *cgi, ch
+     ofs = cgi->readlen - cgi->nl;
+     memmove(cgi->buf, cgi->buf + cgi->nl, ofs);
+   }
+-  // Read either as much buffer space as we have left, or up to 
+-  // the amount of data remaining according to Content-Length
+-  // If there is no Content-Length, just use the buffer space, but recognize
+-  // that it might not work on some servers or cgiwrap implementations.
+-  // Some servers will close their end of the stdin pipe, so cgiwrap_read
+-  // will return if we ask for too much.  Techically, not including
+-  // Content-Length is against the HTTP spec, so we should consider failing
+-  // earlier if we don't have a length.
++  /* Read either as much buffer space as we have left, or up to
++   * the amount of data remaining according to Content-Length
++   * If there is no Content-Length, just use the buffer space, but recognize
++   * that it might not work on some servers or cgiwrap implementations.
++   * Some servers will close their end of the stdin pipe, so cgiwrap_read
++   * will return if we ask for too much.  Techically, not including
++   * Content-Length is against the HTTP spec, so we should consider failing
++   * earlier if we don't have a length. */
+   to_read = cgi->buflen - ofs;
+   if (cgi->data_expected && (to_read > cgi->data_expected - cgi->data_read))
+   {
+diff -pruN clearsilver-0.10.5.orig/cs/csparse.c clearsilver-0.10.5/cs/csparse.c
+--- clearsilver-0.10.5.orig/cs/csparse.c	2007-07-12 04:37:34.000000000 +0200
++++ clearsilver-0.10.5/cs/csparse.c	2008-01-28 12:18:32.000000000 +0100
+@@ -59,7 +59,7 @@ typedef enum
+   ST_DEF = 1<<6,
+   ST_LOOP =  1<<7,
+   ST_ALT = 1<<8,
+-  ST_ESCAPE = 1<<9,
++  ST_ESCAPE = 1<<9
+ } CS_STATE;
+ 
+ #define ST_ANYWHERE (ST_EACH | ST_WITH | ST_ELSE | ST_IF | ST_GLOBAL | ST_DEF | ST_LOOP | ST_ALT | ST_ESCAPE)
+@@ -178,7 +178,8 @@ CS_CMDS Commands[] = {
+     escape_parse, escape_eval, 1},
+   {"/escape",    sizeof("/escape")-1,    ST_ESCAPE,     ST_POP,
+     end_parse, skip_eval, 1},
+-  {NULL},
++  {NULL,    0,    0,    0,
++  	NULL, NULL, 0}
+ };
+ 
+ /* Possible Config.VarEscapeMode values */
+@@ -193,7 +194,7 @@ CS_ESCAPE_MODES EscapeModes[] = {
+   {"html", NEOS_ESCAPE_HTML},
+   {"js",   NEOS_ESCAPE_SCRIPT},
+   {"url",  NEOS_ESCAPE_URL},
+-  {NULL},
++  {NULL,   0}
+ };
+ 
+ 
+@@ -1154,7 +1155,7 @@ static char *token_list (CSTOKEN *tokens
+     {
+       t = snprintf(p, buflen, "%s%d:%s", i ? "  ":"", i, expand_token_type(tokens[i].type, 0));
+     }
+-    if (t == -1 || t >= buflen) return buf;
++    if (t == -1 || t >= (int) buflen) return buf;
+     buflen -= t;
+     p += t;
+   }
+@@ -2567,6 +2568,9 @@ static NEOERR *else_parse (CSPARSE *pars
+   NEOERR *err;
+   STACK_ENTRY *entry;
+ 
++  UNUSED(cmd);
++  UNUSED(arg);
++
+   /* ne_warn ("else"); */
+   err = uListGet (parse->stack, -1, (void *)&entry);
+   if (err != STATUS_OK) return nerr_pass(err);
+@@ -2600,6 +2604,9 @@ static NEOERR *endif_parse (CSPARSE *par
+   NEOERR *err;
+   STACK_ENTRY *entry;
+ 
++  UNUSED(cmd);
++  UNUSED(arg);
++
+   /* ne_warn ("endif"); */
+   err = uListGet (parse->stack, -1, (void *)&entry);
+   if (err != STATUS_OK) return nerr_pass(err);
+@@ -2781,6 +2788,9 @@ static NEOERR *end_parse (CSPARSE *parse
+   NEOERR *err;
+   STACK_ENTRY *entry;
+ 
++  UNUSED(cmd);
++  UNUSED(arg);
++
+   err = uListGet (parse->stack, -1, (void *)&entry);
+   if (err != STATUS_OK) return nerr_pass(err);
+ 
+@@ -2796,6 +2806,8 @@ static NEOERR *include_parse (CSPARSE *p
+   int flags = 0;
+   CSARG arg1, val;
+ 
++  UNUSED(cmd);
++
+   memset(&arg1, 0, sizeof(CSARG));
+   if (arg[0] == '!')
+     flags |= CSF_REQUIRED;
+@@ -3511,6 +3523,8 @@ static NEOERR *loop_eval (CSPARSE *parse
+ 
+ static NEOERR *skip_eval (CSPARSE *parse, CSTREE *node, CSTREE **next)
+ {
++  UNUSED(parse);
++
+   *next = node->next;
+   return STATUS_OK;
+ }
+@@ -3651,6 +3665,8 @@ static NEOERR * _builtin_subcount(CSPARS
+   int count = 0;
+   CSARG val;
+ 
++  UNUSED(csf);
++
+   memset(&val, 0, sizeof(val));
+   err = eval_expr(parse, args, &val);
+   if (err) return nerr_pass(err);
+@@ -3683,6 +3699,8 @@ static NEOERR * _builtin_str_length(CSPA
+   NEOERR *err;
+   CSARG val;
+ 
++  UNUSED(csf);
++
+   memset(&val, 0, sizeof(val));
+   err = eval_expr(parse, args, &val);
+   if (err) return nerr_pass(err);
+@@ -3706,6 +3724,8 @@ static NEOERR * _builtin_str_crc(CSPARSE
+   NEOERR *err;
+   CSARG val;
+ 
++  UNUSED(csf);
++
+   memset(&val, 0, sizeof(val));
+   err = eval_expr(parse, args, &val);
+   if (err) return nerr_pass(err);
+@@ -3731,6 +3751,8 @@ static NEOERR * _builtin_str_find(CSPARS
+   char *substr = NULL;
+   char *pstr = NULL;
+ 
++  UNUSED(csf);
++
+   result->op_type = CS_TYPE_NUM;
+   result->n = -1;
+ 
+@@ -3758,6 +3780,8 @@ static NEOERR * _builtin_name(CSPARSE *p
+   HDF *obj;
+   CSARG val;
+ 
++  UNUSED(csf);
++
+   memset(&val, 0, sizeof(val));
+   err = eval_expr(parse, args, &val);
+   if (err) return nerr_pass(err);
+@@ -3790,6 +3814,8 @@ static NEOERR * _builtin_first(CSPARSE *
+   char *c;
+   CSARG val;
+ 
++  UNUSED(csf);
++
+   memset(&val, 0, sizeof(val));
+   err = eval_expr(parse, args, &val);
+   if (err) return nerr_pass(err);
+@@ -3819,6 +3845,8 @@ static NEOERR * _builtin_last(CSPARSE *p
+   char *c;
+   CSARG val;
+ 
++  UNUSED(csf);
++
+   memset(&val, 0, sizeof(val));
+   err = eval_expr(parse, args, &val);
+   if (err) return nerr_pass(err);
+@@ -3853,6 +3881,8 @@ static NEOERR * _builtin_abs (CSPARSE *p
+   int n1 = 0;
+   CSARG val;
+ 
++  UNUSED(csf);
++
+   memset(&val, 0, sizeof(val));
+   err = eval_expr(parse, args, &val);
+   if (err) return nerr_pass(err);
+@@ -3873,6 +3903,8 @@ static NEOERR * _builtin_max (CSPARSE *p
+   long int n1 = 0;
+   long int n2 = 0;
+ 
++  UNUSED(csf);
++
+   result->op_type = CS_TYPE_NUM;
+   result->n = 0;
+ 
+@@ -3891,6 +3923,8 @@ static NEOERR * _builtin_min (CSPARSE *p
+   long int n1 = 0;
+   long int n2 = 0;
+ 
++  UNUSED(csf);
++
+   result->op_type = CS_TYPE_NUM;
+   result->n = 0;
+ 
+@@ -3910,6 +3944,8 @@ static NEOERR * _builtin_str_slice (CSPA
+   long int e = 0;
+   size_t len;
+ 
++  UNUSED(csf);
++
+   result->op_type = CS_TYPE_STRING;
+   result->s = "";
+ 
+@@ -3921,9 +3957,9 @@ static NEOERR * _builtin_str_slice (CSPA
+   if (b < 0 && e == 0) e = len;
+   if (b < 0) b += len;
+   if (e < 0) e += len;
+-  if (e > len) e = len;
++  if (e > (int) len) e = len;
+   /* Its the whole string */
+-  if (b == 0 && e == len)
++  if (b == 0 && e == (int) len)
+   {
+     result->s = s;
+     result->alloc = 1;
+@@ -4179,10 +4215,10 @@ static NEOERR *cs_init_internal (CSPARSE
+     my_parse->global_hdf = parent->global_hdf;
+     my_parse->fileload = parent->fileload;
+     my_parse->fileload_ctx = parent->fileload_ctx;
+-    // This should be safe since locals handling is done entirely local to the
+-    // eval functions, not globally by the parse handling.  This should
+-    // pass the locals down to the new parse context to make locals work with
+-    // lvar
++    /* This should be safe since locals handling is done entirely local to the
++     * eval functions, not globally by the parse handling.  This should
++     * pass the locals down to the new parse context to make locals work with
++     * lvar */
+     my_parse->locals = parent->locals;
+     my_parse->parent = parent;
+ 
+diff -pruN clearsilver-0.10.5.orig/util/dict.c clearsilver-0.10.5/util/dict.c
+--- clearsilver-0.10.5.orig/util/dict.c	2005-07-01 02:48:26.000000000 +0200
++++ clearsilver-0.10.5/util/dict.c	2008-01-28 12:16:35.000000000 +0100
+@@ -87,6 +87,8 @@ static NEOERR *dictNewItem(dictCtx dict,
+ {
+   dictItemPtr my_item;
+ 
++  UNUSED(dict);
++
+   if (item != NULL)
+     *item = NULL;
+ 
+diff -pruN clearsilver-0.10.5.orig/util/neo_date.h clearsilver-0.10.5/util/neo_date.h
+--- clearsilver-0.10.5.orig/util/neo_date.h	2005-06-30 20:58:48.000000000 +0200
++++ clearsilver-0.10.5/util/neo_date.h	2008-01-28 11:36:14.000000000 +0100
+@@ -17,10 +17,10 @@
+ __BEGIN_DECLS
+ 
+ /* UTC time_t -> struct tm in local timezone */
+-void neo_time_expand (const time_t tt, const char *timezone, struct tm *ttm);
++void neo_time_expand (const time_t tt, const char *tz, struct tm *ttm);
+ 
+ /* local timezone struct tm -> time_t UTC */
+-time_t neo_time_compact (struct tm *ttm, const char *timezone);
++time_t neo_time_compact (struct tm *ttm, const char *tz);
+ 
+ /* To be portable... in seconds */
+ long neo_tz_offset(struct tm *ttm);
+diff -pruN clearsilver-0.10.5.orig/util/neo_files.c clearsilver-0.10.5/util/neo_files.c
+--- clearsilver-0.10.5.orig/util/neo_files.c	2007-07-12 04:14:23.000000000 +0200
++++ clearsilver-0.10.5/util/neo_files.c	2008-01-28 11:53:39.000000000 +0100
+@@ -35,7 +35,7 @@ NEOERR *ne_mkdirs (const char *path, mod
+ 
+   strncpy (mypath, path, sizeof(mypath));
+   x = strlen(mypath);
+-  if ((x < sizeof(mypath)) && (mypath[x-1] != '/'))
++  if ((x < (int) sizeof(mypath)) && (mypath[x-1] != '/'))
+   {
+     mypath[x] = '/';
+     mypath[x+1] = '\0';
+diff -pruN clearsilver-0.10.5.orig/util/neo_hash.c clearsilver-0.10.5/util/neo_hash.c
+--- clearsilver-0.10.5.orig/util/neo_hash.c	2006-10-19 01:57:24.000000000 +0200
++++ clearsilver-0.10.5/util/neo_hash.c	2008-01-28 11:53:09.000000000 +0100
+@@ -57,7 +57,7 @@ void ne_hash_destroy (NE_HASH **hash)
+ 
+   my_hash = *hash;
+ 
+-  for (x = 0; x < my_hash->size; x++)
++  for (x = 0; x < (int) my_hash->size; x++)
+   {
+     node = my_hash->nodes[x];
+     while (node)
+@@ -111,16 +111,16 @@ void *ne_hash_lookup(NE_HASH *hash, void
+ 
+ void *ne_hash_remove(NE_HASH *hash, void *key)
+ {
+-  NE_HASHNODE **node, *remove;
++  NE_HASHNODE **node, *rem;
+   void *value = NULL;
+ 
+   node = _hash_lookup_node(hash, key, NULL);
+   if (*node)
+   {
+-    remove = *node;
+-    *node = remove->next;
+-    value = remove->value;
+-    free(remove);
++    rem = *node;
++    *node = rem->next;
++    value = rem->value;
++    free(rem);
+     hash->num--;
+   }
+   return value;
+@@ -233,7 +233,7 @@ static NEOERR *_hash_resize(NE_HASH *has
+   hash->size = hash->size*2;
+ 
+   /* Initialize new parts */
+-  for (x = orig_size; x < hash->size; x++)
++  for (x = orig_size; x < (int) hash->size; x++)
+   {
+     hash->nodes[x] = NULL;
+   }
+@@ -248,7 +248,7 @@ static NEOERR *_hash_resize(NE_HASH *has
+ 	 entry; 
+ 	 entry = prev ? prev->next : hash->nodes[x]) 
+     {
+-      if ((entry->hashv & hash_mask) != x)
++      if ((int) (entry->hashv & hash_mask) != x)
+       {
+ 	if (prev)
+ 	{
+diff -pruN clearsilver-0.10.5.orig/util/neo_hdf.c clearsilver-0.10.5/util/neo_hdf.c
+--- clearsilver-0.10.5.orig/util/neo_hdf.c	2007-07-12 03:52:37.000000000 +0200
++++ clearsilver-0.10.5/util/neo_hdf.c	2008-01-28 12:24:48.000000000 +0100
+@@ -54,7 +54,7 @@ static UINT32 hash_hdf_hash(const void *
+ }
+ 
+ static NEOERR *_alloc_hdf (HDF **hdf, const char *name, size_t nlen, 
+-                           const char *value, int dup, int wf, HDF *top)
++                           const char *value, int dupl, int wf, HDF *top)
+ {
+   *hdf = calloc (1, sizeof (HDF));
+   if (*hdf == NULL)
+@@ -80,7 +80,7 @@ static NEOERR *_alloc_hdf (HDF **hdf, co
+   }
+   if (value != NULL)
+   {
+-    if (dup)
++    if (dupl)
+     {
+       (*hdf)->alloc_value = 1;
+       (*hdf)->value = strdup(value);
+@@ -233,7 +233,7 @@ static int _walk_hdf (HDF *hdf, const ch
+ 
+   n = name;
+   s = strchr (n, '.');
+-  x = (s == NULL) ? strlen(n) : s - n;
++  x = (s == NULL) ? (int) strlen(n) : s - n;
+ 
+   while (1)
+   {
+@@ -279,7 +279,7 @@ static int _walk_hdf (HDF *hdf, const ch
+     }
+     n = s + 1;
+     s = strchr (n, '.');
+-    x = (s == NULL) ? strlen(n) : s - n;
++    x = (s == NULL) ? (int) strlen(n) : s - n;
+   } 
+   if (hp->link)
+   {
+@@ -570,7 +570,7 @@ NEOERR* _hdf_hash_level(HDF *hdf)
+ }
+ 
+ static NEOERR* _set_value (HDF *hdf, const char *name, const char *value, 
+-                           int dup, int wf, int link, HDF_ATTR *attr, 
++                           int dupl, int wf, int lnk, HDF_ATTR *attr, 
+                            HDF **set_node)
+ {
+   NEOERR *err;
+@@ -615,7 +615,7 @@ static NEOERR* _set_value (HDF *hdf, con
+       hdf->alloc_value = 0;
+       hdf->value = NULL;
+     }
+-    else if (dup)
++    else if (dupl)
+     {
+       hdf->alloc_value = 1;
+       hdf->value = strdup(value);
+@@ -650,7 +650,7 @@ static NEOERR* _set_value (HDF *hdf, con
+     strcpy(new_name, hdf->value);
+     strcat(new_name, ".");
+     strcat(new_name, name);
+-    err = _set_value (hdf->top, new_name, value, dup, wf, link, attr, set_node);
++    err = _set_value (hdf->top, new_name, value, dupl, wf, lnk, attr, set_node);
+     free(new_name);
+     return nerr_pass(err);
+   }
+@@ -719,8 +719,8 @@ skip_search:
+       }
+       else
+       {
+-	err = _alloc_hdf (&hp, n, x, value, dup, wf, hdf->top);
+-	if (link) hp->link = 1;
++	err = _alloc_hdf (&hp, n, x, value, dupl, wf, hdf->top);
++	if (lnk) hp->link = 1;
+ 	else hp->link = 0;
+ 	hp->attr = attr;
+       }
+@@ -770,7 +770,7 @@ skip_search:
+ 	  hp->alloc_value = 0;
+ 	  hp->value = NULL;
+ 	}
+-	else if (dup)
++	else if (dupl)
+ 	{
+ 	  hp->alloc_value = 1;
+ 	  hp->value = strdup(value);
+@@ -784,7 +784,7 @@ skip_search:
+ 	  hp->value = (char *)value;
+ 	}
+       }
+-      if (link) hp->link = 1;
++      if (lnk) hp->link = 1;
+       else hp->link = 0;
+     }
+     else if (hp->link) 
+@@ -796,7 +796,7 @@ skip_search:
+       }
+       strcpy(new_name, hp->value);
+       strcat(new_name, s);
+-      err = _set_value (hdf->top, new_name, value, dup, wf, link, attr, set_node);
++      err = _set_value (hdf->top, new_name, value, dupl, wf, lnk, attr, set_node);
+       free(new_name);
+       return nerr_pass(err);
+     }
+@@ -1267,6 +1267,8 @@ NEOERR* hdf_dump(HDF *hdf, const char *p
+ 
+ NEOERR* hdf_dump_format (HDF *hdf, int lvl, FILE *fp)
+ {
++  UNUSED(lvl);
++
+   return nerr_pass(hdf_dump_cb(hdf, "", DUMP_TYPE_PRETTY, 0, fp, _fp_dump_cb));
+ }
+ 
+@@ -1357,7 +1359,7 @@ static int _copy_line (const char **s, c
+   int x = 0;
+   const char *st = *s;
+ 
+-  while (*st && x < buf_len-1)
++  while (*st && x < (int) buf_len-1)
+   {
+     buf[x++] = *st;
+     if (*st++ == '\n') break;
+@@ -1398,17 +1400,17 @@ static NEOERR *_copy_line_advance(const 
+ 
+ char *_strndup(const char *s, int len) {
+   int x;
+-  char *dup; 
++  char *t;
+   if (s == NULL) return NULL;
+-  dup = (char *) malloc(len+1);
+-  if (dup == NULL) return NULL;
++  t = (char *) malloc(len+1);
++  if (t == NULL) return NULL;
+   for (x = 0; x < len && s[x]; x++)
+   {
+-    dup[x] = s[x];
++    t[x] = s[x];
+   }
+-  dup[x] = '\0';
+-  dup[len] = '\0';
+-  return dup;
++  t[x] = '\0';
++  t[len] = '\0';
++  return t;
+ }
+ 
+ /* attributes are of the form [key1, key2, key3=value, key4="repr"] */
+diff -pruN clearsilver-0.10.5.orig/util/neo_misc.c clearsilver-0.10.5/util/neo_misc.c
+--- clearsilver-0.10.5.orig/util/neo_misc.c	2005-12-06 05:20:13.000000000 +0100
++++ clearsilver-0.10.5/util/neo_misc.c	2008-01-28 11:48:48.000000000 +0100
+@@ -34,7 +34,7 @@ void ne_vwarn (const char *fmt, va_list 
+ 
+   localtime_r(&now, &my_tm);
+ 
+-  strftime(tbuf, sizeof(tbuf), "%m/%d %T", &my_tm);
++  strftime(tbuf, sizeof(tbuf), "%m/%d %H:%M:%S", &my_tm);
+ 
+   vsnprintf (buf, sizeof(buf), fmt, ap);
+   len = strlen(buf);
+diff -pruN clearsilver-0.10.5.orig/util/neo_misc.h clearsilver-0.10.5/util/neo_misc.h
+--- clearsilver-0.10.5.orig/util/neo_misc.h	2007-07-12 04:36:32.000000000 +0200
++++ clearsilver-0.10.5/util/neo_misc.h	2008-01-28 11:36:14.000000000 +0100
+@@ -106,6 +106,10 @@ typedef char BOOL;
+ #define MIN(x,y)        (((x) < (y)) ? (x) : (y))
+ #endif
+ 
++#ifndef UNUSED
++#define UNUSED(x)        ((void)(x))
++#endif
++
+ #ifndef TRUE
+ #define TRUE 1
+ #endif
+diff -pruN clearsilver-0.10.5.orig/util/neo_net.c clearsilver-0.10.5/util/neo_net.c
+--- clearsilver-0.10.5.orig/util/neo_net.c	2005-12-06 05:17:08.000000000 +0100
++++ clearsilver-0.10.5/util/neo_net.c	2008-01-28 11:46:42.000000000 +0100
+@@ -489,7 +489,7 @@ static NEOERR *_ne_net_read_int(NSOCK *s
+   char buf[32];
+   char *ep = NULL;
+ 
+-  while (x < sizeof(buf))
++  while (x < (int) sizeof(buf))
+   {
+     while (sock->il - sock->ib > 0)
+     {
+diff -pruN clearsilver-0.10.5.orig/util/neo_server.c clearsilver-0.10.5/util/neo_server.c
+--- clearsilver-0.10.5.orig/util/neo_server.c	2005-06-30 20:52:00.000000000 +0200
++++ clearsilver-0.10.5/util/neo_server.c	2008-01-28 11:45:38.000000000 +0100
+@@ -104,6 +104,8 @@ static int ShutdownPending = 0;
+ 
+ static void sig_term(int sig)
+ {
++  UNUSED(sig);
++
+   ShutdownPending = 1;
+   ne_net_shutdown();
+ }
+diff -pruN clearsilver-0.10.5.orig/util/neo_str.c clearsilver-0.10.5/util/neo_str.c
+--- clearsilver-0.10.5.orig/util/neo_str.c	2007-07-12 03:24:00.000000000 +0200
++++ clearsilver-0.10.5/util/neo_str.c	2008-01-28 12:21:31.000000000 +0100
+@@ -592,11 +592,11 @@ char *repr_string_alloc (const char *s)
+   return rs;
+ }
+ 
+-// List of all characters that must be escaped
+-// List based on http://www.blooberry.com/indexdot/html/topics/urlencoding.htm
++/* List of all characters that must be escaped
++ * List based on http://www.blooberry.com/indexdot/html/topics/urlencoding.htm */
+ static char EscapedChars[] = "$&+,/:;=?@ \"<>#%{}|\\^~[]`'";
+ 
+-// Check if a single character needs to be escaped
++/* Check if a single character needs to be escaped */
+ static BOOL is_reserved_char(char c)
+ {
+   int i = 0;
+@@ -835,15 +835,15 @@ NEOERR *neos_url_validate (const char *i
+   colonpos = memchr(in, ':', i);
+ 
+   if (colonpos == NULL) {
+-    // no scheme in 'in': so this is a relative url
++    /* no scheme in 'in': so this is a relative url */
+     valid = 1;
+   }
+   else {
+-    for (i = 0; i < num_protocols; i++)
++    for (i = 0; (int) i < num_protocols; i++)
+     {
+       if ((inlen >= strlen(URL_PROTOCOLS[i])) && 
+           strncmp(in, URL_PROTOCOLS[i], strlen(URL_PROTOCOLS[i])) == 0) {
+-        // 'in' starts with one of the allowed protocols
++        /* 'in' starts with one of the allowed protocols */
+         valid = 1;
+         break;
+       }
+@@ -854,7 +854,7 @@ NEOERR *neos_url_validate (const char *i
+   if (valid)
+     return neos_html_escape(in, inlen, esc);
+ 
+-  // 'in' contains an unsupported scheme, replace with '#' 
++  /* 'in' contains an unsupported scheme, replace with '#' */
+   string_init(&out_s);
+   err = string_append (&out_s, "#");
+   if (err) return nerr_pass (err);
+diff -pruN clearsilver-0.10.5.orig/util/skiplist.c clearsilver-0.10.5/util/skiplist.c
+--- clearsilver-0.10.5.orig/util/skiplist.c	2005-06-30 20:52:10.000000000 +0200
++++ clearsilver-0.10.5/util/skiplist.c	2008-01-28 12:22:54.000000000 +0100
+@@ -409,7 +409,7 @@ NEOERR *skipNewList(skipList *skip, int 
+     if (err != STATUS_OK) break;
+ 
+     for(i = 0;                                       /* init header and tail */
+-        i <= list->maxLevel;
++        i <= (UINT32) list->maxLevel;
+         i++) {
+       list->tail->next[i] = NULL;
+       list->header->next[i] = list->tail;
+@@ -444,7 +444,7 @@ static void skipFreeAllItems(skipList li
+   }
+                                                     /* clear header pointers */
+   for(i = 0;
+-      i <= list->maxLevel;
++      i <= (UINT32) list->maxLevel;
+       i++)
+     list->header->next[i] = list->tail;
+ 
diff --git a/libs/clearsilver/patches/101-fix_content_type_ff3.patch b/libs/clearsilver/patches/101-fix_content_type_ff3.patch
new file mode 100644
index 000000000..890851210
--- /dev/null
+++ b/libs/clearsilver/patches/101-fix_content_type_ff3.patch
@@ -0,0 +1,12 @@
+diff -pruN clearsilver-0.10.5.orig/cgi/cgi.c clearsilver-0.10.5/cgi/cgi.c
+--- clearsilver-0.10.5.orig/cgi/cgi.c	2008-05-29 17:59:56.000000000 +0200
++++ clearsilver-0.10.5/cgi/cgi.c	2008-05-29 18:02:51.000000000 +0200
+@@ -642,7 +642,7 @@ NEOERR *cgi_parse (CGI *cgi)
+ 
+   if (!strcmp(method, "POST"))
+   {
+-    if (type && !strcmp(type, "application/x-www-form-urlencoded"))
++    if (type && !strncmp(type, "application/x-www-form-urlencoded", 33))
+     {
+       err = _parse_post_form(cgi);
+       if (err != STATUS_OK) return nerr_pass (err);
diff --git a/libs/clearsilver/patches/102-add_x_requested_http_headers.patch b/libs/clearsilver/patches/102-add_x_requested_http_headers.patch
new file mode 100644
index 000000000..890b0b1e7
--- /dev/null
+++ b/libs/clearsilver/patches/102-add_x_requested_http_headers.patch
@@ -0,0 +1,12 @@
+diff -pruN clearsilver-0.10.5.orig/cgi/cgi.c clearsilver-0.10.5/cgi/cgi.c
+--- clearsilver-0.10.5.orig/cgi/cgi.c	2007-07-12 04:38:03.000000000 +0200
++++ clearsilver-0.10.5/cgi/cgi.c	2008-01-28 12:04:50.000000000 +0100
+@@ -201,6 +201,8 @@ struct _http_vars
+   {"HTTP_IF_MODIFIED_SINCE", "IfModifiedSince"},
+   {"HTTP_REFERER", "Referer"},
+   {"HTTP_VIA", "Via"},
++  {"HTTP_X_REQUESTED_WITH", "XRequestedWith"},
++  {"HTTP_X_REQUESTED_HANDLER", "XRequestedHandler"},	
+   /* SOAP */
+   {"HTTP_SOAPACTION", "Soap.Action"},
+   {NULL, NULL}