diff options
author | Christophe Jaillet <jailletc36@apache.org> | 2015-09-07 07:24:43 +0200 |
---|---|---|
committer | Christophe Jaillet <jailletc36@apache.org> | 2015-09-07 07:24:43 +0200 |
commit | dcad11179f000025953df229eecd97f265c73e78 (patch) | |
tree | 5d21858b077d955b366862448ce94b0ee53d30c6 /modules/mappers/mod_rewrite.c | |
parent | Revert r1697735. (diff) | |
download | apache2-dcad11179f000025953df229eecd97f265c73e78.tar.xz apache2-dcad11179f000025953df229eecd97f265c73e78.zip |
Improve macro definition in order to avoid potential precedence issues.
For example, sparse spotted that the following line was spurious:
newcond->flags &= ~CONDFLAG_NOCASE;
It this particular case, 2 bits were resetted (instead of only 1). This was harmless because the first bit (i.e. CONDFLAG_NONE) is never tested as-is.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1701545 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/mappers/mod_rewrite.c')
-rw-r--r-- | modules/mappers/mod_rewrite.c | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index b25acdec0d..b506e30b8c 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -146,61 +146,61 @@ static const char* really_last_key = "rewrite_really_last"; #define REDIRECT_ENVVAR_SCRIPT_URL "REDIRECT_" ENVVAR_SCRIPT_URL #define ENVVAR_SCRIPT_URI "SCRIPT_URI" -#define CONDFLAG_NONE 1<<0 -#define CONDFLAG_NOCASE 1<<1 -#define CONDFLAG_NOTMATCH 1<<2 -#define CONDFLAG_ORNEXT 1<<3 -#define CONDFLAG_NOVARY 1<<4 - -#define RULEFLAG_NONE 1<<0 -#define RULEFLAG_FORCEREDIRECT 1<<1 -#define RULEFLAG_LASTRULE 1<<2 -#define RULEFLAG_NEWROUND 1<<3 -#define RULEFLAG_CHAIN 1<<4 -#define RULEFLAG_IGNOREONSUBREQ 1<<5 -#define RULEFLAG_NOTMATCH 1<<6 -#define RULEFLAG_PROXY 1<<7 -#define RULEFLAG_PASSTHROUGH 1<<8 -#define RULEFLAG_QSAPPEND 1<<9 -#define RULEFLAG_NOCASE 1<<10 -#define RULEFLAG_NOESCAPE 1<<11 -#define RULEFLAG_NOSUB 1<<12 -#define RULEFLAG_STATUS 1<<13 -#define RULEFLAG_ESCAPEBACKREF 1<<14 -#define RULEFLAG_DISCARDPATHINFO 1<<15 -#define RULEFLAG_QSDISCARD 1<<16 -#define RULEFLAG_END 1<<17 -#define RULEFLAG_ESCAPENOPLUS 1<<18 +#define CONDFLAG_NONE (1<<0) +#define CONDFLAG_NOCASE (1<<1) +#define CONDFLAG_NOTMATCH (1<<2) +#define CONDFLAG_ORNEXT (1<<3) +#define CONDFLAG_NOVARY (1<<4) + +#define RULEFLAG_NONE (1<<0) +#define RULEFLAG_FORCEREDIRECT (1<<1) +#define RULEFLAG_LASTRULE (1<<2) +#define RULEFLAG_NEWROUND (1<<3) +#define RULEFLAG_CHAIN (1<<4) +#define RULEFLAG_IGNOREONSUBREQ (1<<5) +#define RULEFLAG_NOTMATCH (1<<6) +#define RULEFLAG_PROXY (1<<7) +#define RULEFLAG_PASSTHROUGH (1<<8) +#define RULEFLAG_QSAPPEND (1<<9) +#define RULEFLAG_NOCASE (1<<10) +#define RULEFLAG_NOESCAPE (1<<11) +#define RULEFLAG_NOSUB (1<<12) +#define RULEFLAG_STATUS (1<<13) +#define RULEFLAG_ESCAPEBACKREF (1<<14) +#define RULEFLAG_DISCARDPATHINFO (1<<15) +#define RULEFLAG_QSDISCARD (1<<16) +#define RULEFLAG_END (1<<17) +#define RULEFLAG_ESCAPENOPLUS (1<<18) /* return code of the rewrite rule * the result may be escaped - or not */ -#define ACTION_NORMAL 1<<0 -#define ACTION_NOESCAPE 1<<1 -#define ACTION_STATUS 1<<2 - - -#define MAPTYPE_TXT 1<<0 -#define MAPTYPE_DBM 1<<1 -#define MAPTYPE_PRG 1<<2 -#define MAPTYPE_INT 1<<3 -#define MAPTYPE_RND 1<<4 -#define MAPTYPE_DBD 1<<5 -#define MAPTYPE_DBD_CACHE 1<<6 - -#define ENGINE_DISABLED 1<<0 -#define ENGINE_ENABLED 1<<1 - -#define OPTION_NONE 1<<0 -#define OPTION_INHERIT 1<<1 -#define OPTION_INHERIT_BEFORE 1<<2 -#define OPTION_NOSLASH 1<<3 -#define OPTION_ANYURI 1<<4 -#define OPTION_MERGEBASE 1<<5 -#define OPTION_INHERIT_DOWN 1<<6 -#define OPTION_INHERIT_DOWN_BEFORE 1<<7 -#define OPTION_IGNORE_INHERIT 1<<8 -#define OPTION_IGNORE_CONTEXT_INFO 1<<9 +#define ACTION_NORMAL (1<<0) +#define ACTION_NOESCAPE (1<<1) +#define ACTION_STATUS (1<<2) + + +#define MAPTYPE_TXT (1<<0) +#define MAPTYPE_DBM (1<<1) +#define MAPTYPE_PRG (1<<2) +#define MAPTYPE_INT (1<<3) +#define MAPTYPE_RND (1<<4) +#define MAPTYPE_DBD (1<<5) +#define MAPTYPE_DBD_CACHE (1<<6) + +#define ENGINE_DISABLED (1<<0) +#define ENGINE_ENABLED (1<<1) + +#define OPTION_NONE (1<<0) +#define OPTION_INHERIT (1<<1) +#define OPTION_INHERIT_BEFORE (1<<2) +#define OPTION_NOSLASH (1<<3) +#define OPTION_ANYURI (1<<4) +#define OPTION_MERGEBASE (1<<5) +#define OPTION_INHERIT_DOWN (1<<6) +#define OPTION_INHERIT_DOWN_BEFORE (1<<7) +#define OPTION_IGNORE_INHERIT (1<<8) +#define OPTION_IGNORE_CONTEXT_INFO (1<<9) #ifndef RAND_MAX #define RAND_MAX 32767 |