← Commit list

c8d7109f6

Denis Vlasenko
Denis Vlasenko
2009-04-22
FAILED Duration: 38s

Subject

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

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

networking/httpd.c+3 -4
@@ -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 @@ 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);