tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
Date Tue, 14 Dec 2004 20:17:05 GMT
mturk       2004/12/14 12:17:05

  Modified:    jk/native/iis jk_isapi_plugin.c
  Log:
  Use stristr function instead converting the string to lowercase.
  
  Revision  Changes    Path
  1.32      +24 -13    jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c
  
  Index: jk_isapi_plugin.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- jk_isapi_plugin.c	14 Dec 2004 19:19:04 -0000	1.31
  +++ jk_isapi_plugin.c	14 Dec 2004 20:17:05 -0000	1.32
  @@ -343,22 +343,33 @@
       return JK_TRUE;
   }
   
  -static int uri_is_web_inf(const char *uri)
  +/*
  + * Find the first occurrence of find in s.
  + */
  +static char *stristr(const char *s, const char *find)
   {
  -    char b[INTERNET_MAX_URL_LENGTH + 1];
  -    int i = 0;
  +	char c, sc;
  +	size_t len;
   
  -    while (*uri) {
  -        b[i++] = JK_TOLOWER(*uri);
  -        uri++;
  -        if (i > (INTERNET_MAX_URL_LENGTH - 1))
  -            break;
  -    }
  -    b[i] = '\0';
  -    if (strstr(b, "web-inf")) {
  +	if ((c = tolower((unsigned char)(*find++))) != 0) {
  +		len = strlen(find);
  +		do {
  +			do {
  +				if ((sc = tolower((unsigned char)(*s++))) == 0)
  +					return (NULL);
  +			} while (sc != c);
  +		} while (strnicmp(s, find, len) != 0);
  +		s--;
  +	}
  +	return ((char *)s);
  +} 
  +
  +static int uri_is_web_inf(const char *uri)
  +{
  +    if (stristr(uri, "web-inf")) {
           return JK_TRUE;
       }
  -    if (strstr(b, "meta-inf")) {
  +    if (stristr(uri, "meta-inf")) {
           return JK_TRUE;
       }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message