From: Stefan Fritsch Date: Tue, 3 Aug 2010 19:49:21 +0000 (+0000) Subject: remove some useless use of strlen() X-Git-Tag: 2.3.7~40 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f0fdf298c31e42ffa7aa97c078b3866dfe19cc89;p=thirdparty%2Fapache%2Fhttpd.git remove some useless use of strlen() git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@982017 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index a1cad924dea..b37766f94f7 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -3385,7 +3385,7 @@ static const char *cmd_rewriterule_setflag(apr_pool_t *p, void *_cfg, int status = 0; cfg->flags |= RULEFLAG_FORCEREDIRECT; - if (strlen(val) > 0) { + if (*val) { if (strcasecmp(val, "permanent") == 0) { status = HTTP_MOVED_PERMANENTLY; } diff --git a/modules/mappers/mod_userdir.c b/modules/mappers/mod_userdir.c index 9c2e456b7d8..e396b035f3b 100644 --- a/modules/mappers/mod_userdir.c +++ b/modules/mappers/mod_userdir.c @@ -136,7 +136,7 @@ static const char *set_user_dir(cmd_parms *cmd, void *dummy, const char *arg) * If there are no usernames specified, this is a global disable - we * need do no more at this point than record the fact. */ - if (strlen(usernames) == 0) { + if (!*usernames) { s_cfg->globally_disabled = 1; return NULL; } @@ -148,7 +148,7 @@ static const char *set_user_dir(cmd_parms *cmd, void *dummy, const char *arg) * the "enable" keyword requires the list. Whinge if it doesn't have * it. */ - if (strlen(usernames) == 0) { + if (!*usernames) { return "UserDir \"enable\" keyword requires a list of usernames"; } usertable = s_cfg->enabled_users; diff --git a/modules/metadata/mod_usertrack.c b/modules/metadata/mod_usertrack.c index 8df944a4307..c626587c57f 100644 --- a/modules/metadata/mod_usertrack.c +++ b/modules/metadata/mod_usertrack.c @@ -380,7 +380,7 @@ static const char *set_cookie_domain(cmd_parms *cmd, void *mconfig, /* * Apply the restrictions on cookie domain attributes. */ - if (strlen(name) == 0) { + if (!name[0]) { return "CookieDomain values may not be null"; } if (name[0] != '.') {