r9645 jmb - /branches/jmb/new-cache/content/llcache.c

netsurf at semichrome.net netsurf at semichrome.net
Thu Oct 15 02:50:13 BST 2009


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.c?rev=9645&r1=9644&r2=9645&view=diff
==============================================================================
--- 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;
 




More information about the netsurf-commits mailing list