From: Fabian Keil <fk@fabiankeil.de>
Date: Mon, 14 Feb 2011 16:07:11 +0000 (+0000)
Subject: More clean-ups for cgi_send_user_manual()
X-Git-Tag: v_3_0_18~332
X-Git-Url: http://www.privoxy.org/gitweb/@default-cgi@/faq/%22https:/developer-manual/static/@default-cgi@show-url-info?a=commitdiff_plain;h=e8593756d71ab52867e66572c8abd0b650005c9e;p=privoxy.git

More clean-ups for cgi_send_user_manual()
---

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;
 }