httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: apache-1.3/src/main http_main.c
Date Thu, 22 Feb 2001 16:07:17 GMT
wrowe       01/02/22 08:07:17

  Modified:    src/main http_main.c
  Log:
    As martin points out, no2slash took care of the loop, and testing the
    first char is far quicker than testing strlen() > 0.
  
  Revision  Changes    Path
  1.530     +3 -3      apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.529
  retrieving revision 1.530
  diff -u -r1.529 -r1.530
  --- http_main.c	2001/02/15 04:19:45	1.529
  +++ http_main.c	2001/02/22 16:07:16	1.530
  @@ -6846,9 +6846,9 @@
               ap_cpystrn(ap_server_root, optarg, sizeof(ap_server_root));
               ap_getparents(ap_server_root);
               ap_no2slash(ap_server_root);
  -            while (strlen(ap_server_root) 
  -                    && ap_server_root[strlen(ap_server_root)-1] == '/')
  -                ap_server_root[strlen(ap_server_root)-1] = '\0';
  +            if (ap_server_root[0] 
  +                    && ap_server_root[strlen(ap_server_root) - 1] == '/')
  +                ap_server_root[strlen(ap_server_root) - 1] = '\0';
   	    break;
   	case 'f':
               ap_cpystrn(ap_server_confname,
  
  
  

Mime
View raw message