diff options
author | Joe Orton <jorton@apache.org> | 2019-06-27 11:22:48 +0200 |
---|---|---|
committer | Joe Orton <jorton@apache.org> | 2019-06-27 11:22:48 +0200 |
commit | 420025bf9f8eca5b410c684069a2bcb726bd9e93 (patch) | |
tree | b2e0b9c8ff79ad94f86d28232f2ae36756cdcba8 | |
parent | * docs/conf/magic: Allow mod_mime_magic to return "audio/x-wav" for (diff) | |
download | apache2-420025bf9f8eca5b410c684069a2bcb726bd9e93.tar.xz apache2-420025bf9f8eca5b410c684069a2bcb726bd9e93.zip |
* modules/metadata/mod_mime_magic.c: Constify some constant
data, remove unused "suf_recursion" field. No functional
change.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1862202 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | modules/metadata/mod_mime_magic.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/modules/metadata/mod_mime_magic.c b/modules/metadata/mod_mime_magic.c index d144621db1..a6dc49ed00 100644 --- a/modules/metadata/mod_mime_magic.c +++ b/modules/metadata/mod_mime_magic.c @@ -257,7 +257,7 @@ static int fsmagic(request_rec *r, const char *fn); #define L_MAIL 8 /* Electronic mail */ #define L_NEWS 9 /* Usenet Netnews */ -static const char *types[] = +static const char *const types[] = { "text/html", /* HTML */ "text/plain", /* "c program text", */ @@ -462,7 +462,6 @@ typedef struct { typedef struct { magic_rsl *head; /* result string list */ magic_rsl *tail; - unsigned suf_recursion; /* recursion depth in suffix check */ } magic_req_rec; /* @@ -2044,12 +2043,12 @@ static int ascmagic(request_rec *r, unsigned char *buf, apr_size_t nbytes) * - uncompress old into new, using method, return sizeof new */ -static struct { - char *magic; +static const struct { + const char *magic; apr_size_t maglen; - char *argv[3]; + const char *argv[3]; int silent; - char *encoding; /* MUST be lowercase */ + const char *encoding; /* MUST be lowercase */ } compr[] = { /* we use gzip here rather than uncompress because we have to pass @@ -2077,7 +2076,7 @@ static struct { }, }; -static int ncompr = sizeof(compr) / sizeof(compr[0]); +#define ncompr (sizeof(compr) / sizeof(compr[0])) static int zmagic(request_rec *r, unsigned char *buf, apr_size_t nbytes) { |