You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sf...@apache.org on 2011/06/22 22:24:28 UTC
svn commit: r1138617 - in /httpd/httpd/trunk: include/ap_mmn.h
include/httpd.h modules/mappers/mod_rewrite.c os/bs2000/os.c
os/unix/unixd.c server/util.c server/util_expr_eval.c
Author: sf
Date: Wed Jun 22 20:24:27 2011
New Revision: 1138617
URL: http://svn.apache.org/viewvc?rev=1138617&view=rev
Log:
We already have ap_str_tolower(), so also add ap_str_toupper() function and use
it where possible.
Modified:
httpd/httpd/trunk/include/ap_mmn.h
httpd/httpd/trunk/include/httpd.h
httpd/httpd/trunk/modules/mappers/mod_rewrite.c
httpd/httpd/trunk/os/bs2000/os.c
httpd/httpd/trunk/os/unix/unixd.c
httpd/httpd/trunk/server/util.c
httpd/httpd/trunk/server/util_expr_eval.c
Modified: httpd/httpd/trunk/include/ap_mmn.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/ap_mmn.h?rev=1138617&r1=1138616&r2=1138617&view=diff
==============================================================================
--- httpd/httpd/trunk/include/ap_mmn.h (original)
+++ httpd/httpd/trunk/include/ap_mmn.h Wed Jun 22 20:24:27 2011
@@ -336,6 +336,7 @@
* 20110619.0 (2.3.13-dev) add async connection infos to process_score in scoreboard,
* add ap_start_lingering_close(),
* add conn_state_e:CONN_STATE_LINGER_NORMAL and CONN_STATE_LINGER_SHORT
+ * 20110619.1 (2.3.13-dev) add ap_str_toupper()
*/
#define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
@@ -343,7 +344,7 @@
#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20110619
#endif
-#define MODULE_MAGIC_NUMBER_MINOR 0 /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 1 /* 0...n */
/**
* Determine if the server's current MODULE_MAGIC_NUMBER is at least a
Modified: httpd/httpd/trunk/include/httpd.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/httpd.h?rev=1138617&r1=1138616&r2=1138617&view=diff
==============================================================================
--- httpd/httpd/trunk/include/httpd.h (original)
+++ httpd/httpd/trunk/include/httpd.h Wed Jun 22 20:24:27 2011
@@ -1799,6 +1799,12 @@ AP_DECLARE(void) ap_content_type_tolower
AP_DECLARE(void) ap_str_tolower(char *s);
/**
+ * convert a string to all uppercase
+ * @param s The string to convert to uppercase
+ */
+AP_DECLARE(void) ap_str_toupper(char *s);
+
+/**
* Search a string from left to right for the first occurrence of a
* specific character
* @param str The string to search
Modified: httpd/httpd/trunk/modules/mappers/mod_rewrite.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mappers/mod_rewrite.c?rev=1138617&r1=1138616&r2=1138617&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/mappers/mod_rewrite.c (original)
+++ httpd/httpd/trunk/modules/mappers/mod_rewrite.c Wed Jun 22 20:24:27 2011
@@ -1051,11 +1051,7 @@ static int init_cache(apr_pool_t *p)
static char *rewrite_mapfunc_toupper(request_rec *r, char *key)
{
- char *p;
-
- for (p = key; *p; ++p) {
- *p = apr_toupper(*p);
- }
+ ap_str_toupper(key);
return key;
}
@@ -1849,13 +1845,10 @@ static char *lookup_variable(char *var,
/* well, do it the hard way */
else {
- char *p;
apr_time_exp_t tm;
/* can't do this above, because of the getenv call */
- for (p = var; *p; ++p) {
- *p = apr_toupper(*p);
- }
+ ap_str_toupper(var);
switch (varlen) {
case 4:
Modified: httpd/httpd/trunk/os/bs2000/os.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/os/bs2000/os.c?rev=1138617&r1=1138616&r2=1138617&view=diff
==============================================================================
--- httpd/httpd/trunk/os/bs2000/os.c (original)
+++ httpd/httpd/trunk/os/bs2000/os.c Wed Jun 22 20:24:27 2011
@@ -42,15 +42,6 @@ typedef enum
static bs2_ForkType forktype = bs2_unknown;
-
-static void ap_str_toupper(char *str)
-{
- while (*str) {
- *str = apr_toupper(*str);
- ++str;
- }
-}
-
/* Determine the method for forking off a child in such a way as to
* set both the POSIX and BS2000 user id's to the unprivileged user.
*/
Modified: httpd/httpd/trunk/os/unix/unixd.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/os/unix/unixd.c?rev=1138617&r1=1138616&r2=1138617&view=diff
==============================================================================
--- httpd/httpd/trunk/os/unix/unixd.c (original)
+++ httpd/httpd/trunk/os/unix/unixd.c Wed Jun 22 20:24:27 2011
@@ -453,15 +453,6 @@ typedef enum
static bs2_ForkType forktype = bs2_unknown;
-
-static void ap_str_toupper(char *str)
-{
- while (*str) {
- *str = apr_toupper(*str);
- ++str;
- }
-}
-
/* Determine the method for forking off a child in such a way as to
* set both the POSIX and BS2000 user id's to the unprivileged user.
*/
Modified: httpd/httpd/trunk/server/util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util.c?rev=1138617&r1=1138616&r2=1138617&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util.c (original)
+++ httpd/httpd/trunk/server/util.c Wed Jun 22 20:24:27 2011
@@ -1889,6 +1889,14 @@ AP_DECLARE(void) ap_str_tolower(char *st
}
}
+AP_DECLARE(void) ap_str_toupper(char *str)
+{
+ while (*str) {
+ *str = apr_toupper(*str);
+ ++str;
+ }
+}
+
/*
* We must return a FQDN
*/
Modified: httpd/httpd/trunk/server/util_expr_eval.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util_expr_eval.c?rev=1138617&r1=1138616&r2=1138617&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util_expr_eval.c (original)
+++ httpd/httpd/trunk/server/util_expr_eval.c Wed Jun 22 20:24:27 2011
@@ -831,13 +831,8 @@ static const char *tolower_func(ap_expr_
static const char *toupper_func(ap_expr_eval_ctx_t *ctx, const void *data,
const char *arg)
{
- char *p;
char *result = apr_pstrdup(ctx->p, arg);
-
- for (p = result; *p; ++p) {
- *p = apr_toupper(*p);
- }
-
+ ap_str_toupper(result);
return result;
}