From e8593756d71ab52867e66572c8abd0b650005c9e Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Mon, 14 Feb 2011 16:07:11 +0000 Subject: [PATCH] More clean-ups for cgi_send_user_manual() --- cgisimple.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/cgisimple.c b/cgisimple.c index 7a4e03e7..e9778e5d 100644 --- a/cgisimple.c +++ b/cgisimple.c @@ -1,4 +1,4 @@ -const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.102 2011/02/14 16:05:37 fabiankeil Exp $"; +const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.103 2011/02/14 16:06:37 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgisimple.c,v $ @@ -721,9 +721,10 @@ jb_err cgi_send_user_manual(struct client_state *csp, struct http_response *rsp, const struct map *parameters) { - const char * filename; + const char *filename; char *full_path; jb_err err = JB_ERR_OK; + const char *content_type; assert(csp); assert(rsp); @@ -779,20 +780,12 @@ jb_err cgi_send_user_manual(struct client_state *csp, } freez(full_path); - /* Guess correct Content-Type based on the filename's ending */ - if (filename) - { - const char *content_type = get_content_type(filename); - log_error(LOG_LEVEL_CGI, - "Content-Type guessed for %s: %s", filename, content_type); - err = enlist_unique_header(rsp->headers, "Content-Type", content_type); - } - else - { - /* XXX: why should this happen */ - } + content_type = get_content_type(filename); + log_error(LOG_LEVEL_CGI, + "Content-Type guessed for %s: %s", filename, content_type); + + return enlist_unique_header(rsp->headers, "Content-Type", content_type); - return err; } -- 2.39.2