Author: jmb
Date: Wed Oct 14 20:50:13 2009
New Revision: 9645
URL:
http://source.netsurf-browser.org?rev=9645&view=rev
Log:
Fix header parsing to extract header name correctly.
Modified:
branches/jmb/new-cache/content/llcache.c
Modified: branches/jmb/new-cache/content/llcache.c
URL:
http://source.netsurf-browser.org/branches/jmb/new-cache/content/llcache....
==============================================================================
--- branches/jmb/new-cache/content/llcache.c (original)
+++ branches/jmb/new-cache/content/llcache.c Wed Oct 14 20:50:13 2009
@@ -1376,12 +1376,12 @@
}
/* Strip trailing whitespace from name */
- do {
+ while (colon > data && (colon[-1] == ' ' ||
+ colon[-1] == '\t' || colon[-1] == '\r' ||
+ colon[-1] == '\n'))
colon--;
- } while (*colon == ' ' || *colon == '\t' ||
- *colon == '\r' || *colon == '\n');
-
- n = strndup(data, colon - data - 1);
+
+ n = strndup(data, colon - data);
if (n == NULL)
return NSERROR_NOMEM;