httpd: fix small bug in parser. it crept in during cleanup
authorDenis Vlasenko <vda.linux@googlemail.com>
Wed, 22 Apr 2009 14:16:59 +0000 (14:16 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Wed, 22 Apr 2009 14:16:59 +0000 (14:16 -0000)
networking/httpd.c

index 794a39ea05608b0b0ac92accacd3905b3017171c..b8aa02fe42746d66bc80e0dbe40b2da8e50ace96 100644 (file)
 # include <sys/sendfile.h>
 #endif
 
-//#define DEBUG 1
 #define DEBUG 0
 
 #define IOBUF_SIZE 8192    /* IO buffer */
@@ -698,13 +697,13 @@ static void parse_conf(const char *path, int flag)
                        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);