svn commit: [26186] trunk/busybox/networking

vda at busybox.net vda at busybox.net
Wed Apr 22 14:16:59 UTC 2009


Author: vda
Date: 2009-04-22 14:16:59 +0000 (Wed, 22 Apr 2009)
New Revision: 26186

Log:
httpd: fix small bug in parser. it crept in during cleanup



Modified:
   trunk/busybox/networking/httpd.c


Changeset:
Modified: trunk/busybox/networking/httpd.c
===================================================================
--- trunk/busybox/networking/httpd.c	2009-04-22 13:52:22 UTC (rev 26185)
+++ trunk/busybox/networking/httpd.c	2009-04-22 14:16:59 UTC (rev 26186)
@@ -100,7 +100,6 @@
 # include <sys/sendfile.h>
 #endif
 
-//#define DEBUG 1
 #define DEBUG 0
 
 #define IOBUF_SIZE 8192    /* IO buffer */
@@ -698,13 +697,13 @@
 			unsigned file_len;
 
 			/* note: path is "" unless we are in SUBDIR parse,
-			 * otherwise it always starts with "/" */
+			 * otherwise it does NOT start with "/" */
 			cur = xzalloc(sizeof(*cur) /* includes space for NUL */
-				+ strlen(path)
+				+ 1 + strlen(path)
 				+ strlen_buf
 				);
 			/* form "/path/file" */
-			sprintf(cur->before_colon, "%s%.*s",
+			sprintf(cur->before_colon, "/%s%.*s",
 				path,
 				after_colon - buf - 1, /* includes "/", but not ":" */
 				buf);



More information about the busybox-cvs mailing list