From 2f283a1dcd7dfc290cec4b1284892eb5af5de45c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Malo?= Date: Wed, 23 Jul 2003 13:32:14 +0000 Subject: [PATCH] don't compute the strlen of dconf->directory three times Submitted by: Justin git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100744 13f79535-47bb-0310-9956-ffa450edef68 --- modules/mappers/mod_rewrite.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index 7e2ac2d851..88f951db5c 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -1449,7 +1449,7 @@ static int hook_fixup(request_rec *r) char *cp2; const char *ccp; char *prefix; - int l; + apr_size_t l; int rulestatus; int n; char *ofilename; @@ -1478,10 +1478,10 @@ static int hook_fixup(request_rec *r) * URL: http://localhost/foo and .htaccess is located in foo directory * Ignore such attempts, since they may lead to undefined behaviour. */ - if (r->filename && - strlen(r->filename) == strlen(dconf->directory) - 1 && - (dconf->directory)[strlen(dconf->directory) - 1] == '/' && - !strncmp(r->filename, dconf->directory, strlen(dconf->directory) - 1)) { + l = strlen(dconf->directory) - 1; + if (r->filename && strlen(r->filename) == l && + (dconf->directory)[l] == '/' && + !strncmp(r->filename, dconf->directory, l)) { return DECLINED; } -- 2.50.1