diff options
author | Stefan Fritsch <sf@apache.org> | 2011-06-13 13:20:18 +0200 |
---|---|---|
committer | Stefan Fritsch <sf@apache.org> | 2011-06-13 13:20:18 +0200 |
commit | 04d48349bbbbeb10e523058d855e9cb8607a9a34 (patch) | |
tree | 693c437997d76deb020b6da950a9b668b937cab3 /modules/mappers | |
parent | Merge repeated calls of ap_rputs. (diff) | |
download | apache2-04d48349bbbbeb10e523058d855e9cb8607a9a34.tar.xz apache2-04d48349bbbbeb10e523058d855e9cb8607a9a34.zip |
Code cleanup:
1) use apr_palloc instead of apr_pcalloc when all the fields of the allocated
structure are set afterwards.
2) avoid useless calls to 'strcasecmp' when we have already found what we are
looking for.
Submitted by: Christophe JAILLET <christophe jaillet wanadoo fr>
PR: 51329
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1135089 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/mappers')
-rw-r--r-- | modules/mappers/mod_imagemap.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/modules/mappers/mod_imagemap.c b/modules/mappers/mod_imagemap.c index 6ea44d0870..5fc47970c4 100644 --- a/modules/mappers/mod_imagemap.c +++ b/modules/mappers/mod_imagemap.c @@ -101,7 +101,7 @@ static void *create_imap_dir_config(apr_pool_t *p, char *dummy) static void *merge_imap_dir_configs(apr_pool_t *p, void *basev, void *addv) { - imap_conf_rec *new = (imap_conf_rec *) apr_pcalloc(p, sizeof(imap_conf_rec)); + imap_conf_rec *new = (imap_conf_rec *) apr_palloc(p, sizeof(imap_conf_rec)); imap_conf_rec *base = (imap_conf_rec *) basev; imap_conf_rec *add = (imap_conf_rec *) addv; @@ -495,10 +495,10 @@ static void menu_blank(request_rec *r, char *menu) if (!strcasecmp(menu, "formatted")) { ap_rputs("\n", r); } - if (!strcasecmp(menu, "semiformatted")) { + else if (!strcasecmp(menu, "semiformatted")) { ap_rputs("<br />\n", r); } - if (!strcasecmp(menu, "unformatted")) { + else if (!strcasecmp(menu, "unformatted")) { ap_rputs("\n", r); } return; @@ -509,10 +509,10 @@ static void menu_comment(request_rec *r, char *menu, char *comment) if (!strcasecmp(menu, "formatted")) { ap_rputs("\n", r); /* print just a newline if 'formatted' */ } - if (!strcasecmp(menu, "semiformatted") && *comment) { + else if (!strcasecmp(menu, "semiformatted") && *comment) { ap_rvputs(r, comment, "\n", NULL); } - if (!strcasecmp(menu, "unformatted") && *comment) { + else if (!strcasecmp(menu, "unformatted") && *comment) { ap_rvputs(r, comment, "\n", NULL); } return; /* comments are ignored in the @@ -529,11 +529,11 @@ static void menu_default(request_rec *r, char *menu, char *href, char *text) ap_rvputs(r, "<pre>(Default) <a href=\"", href, "\">", text, "</a></pre>\n", NULL); } - if (!strcasecmp(menu, "semiformatted")) { + else if (!strcasecmp(menu, "semiformatted")) { ap_rvputs(r, "<pre>(Default) <a href=\"", href, "\">", text, "</a></pre>\n", NULL); } - if (!strcasecmp(menu, "unformatted")) { + else if (!strcasecmp(menu, "unformatted")) { ap_rvputs(r, "<a href=\"", href, "\">", text, "</a>", NULL); } return; @@ -549,11 +549,11 @@ static void menu_directive(request_rec *r, char *menu, char *href, char *text) ap_rvputs(r, "<pre> <a href=\"", href, "\">", text, "</a></pre>\n", NULL); } - if (!strcasecmp(menu, "semiformatted")) { + else if (!strcasecmp(menu, "semiformatted")) { ap_rvputs(r, "<pre> <a href=\"", href, "\">", text, "</a></pre>\n", NULL); } - if (!strcasecmp(menu, "unformatted")) { + else if (!strcasecmp(menu, "unformatted")) { ap_rvputs(r, "<a href=\"", href, "\">", text, "</a>", NULL); } return; |