You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by rj...@apache.org on 2010/10/15 18:59:41 UTC

svn commit: r1023020 - /tomcat/jk/trunk/native/common/jk_map.c

Author: rjung
Date: Fri Oct 15 16:59:40 2010
New Revision: 1023020

URL: http://svn.apache.org/viewvc?rev=1023020&view=rev
Log:
Fix test that returns always true.

Only a problem, if the token to trim were actually
empty.

Modified:
    tomcat/jk/trunk/native/common/jk_map.c

Modified: tomcat/jk/trunk/native/common/jk_map.c
URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/common/jk_map.c?rev=1023020&r1=1023019&r2=1023020&view=diff
==============================================================================
--- tomcat/jk/trunk/native/common/jk_map.c (original)
+++ tomcat/jk/trunk/native/common/jk_map.c Fri Oct 15 16:59:40 2010
@@ -634,10 +634,13 @@ static size_t trim(char *s)
     /* check for empty strings */
     if (!(i = strlen(s)))
         return 0;
-    for (i = i - 1; (i >= 0) &&
+    for (i = i - 1; (i > 0) &&
          isspace((int)((unsigned char)s[i])); i--);
+    if ((i > 0) || !isspace((int)((unsigned char)s[i]))) {
+       i++;
+    }
 
-    s[i + 1] = '\0';
+    s[i] = '\0';
 
     for (i = 0; ('\0' != s[i]) &&
          isspace((int)((unsigned char)s[i])); i++);



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