don't assume the relpath is really set (merge from #120)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@695 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.6
Jan Kneschke 2005-09-08 09:57:55 +00:00
parent 4b63eae57d
commit 57ed250138
1 changed files with 2 additions and 1 deletions

View File

@ -342,7 +342,8 @@ handler_t http_response_prepare(server *srv, connection *con) {
buffer_copy_string_buffer(con->physical.path, con->physical.doc_root);
BUFFER_APPEND_SLASH(con->physical.path);
buffer_copy_string_buffer(con->physical.basedir, con->physical.path);
if (con->physical.rel_path->ptr[0] == '/') {
if (con->physical.rel_path->used &&
con->physical.rel_path->ptr[0] == '/') {
buffer_append_string_len(con->physical.path, con->physical.rel_path->ptr + 1, con->physical.rel_path->used - 2);
} else {
buffer_append_string_buffer(con->physical.path, con->physical.rel_path);