costin      02/04/11 12:32:04

  Modified:    jk/native2/common jk_config.c
  Log:
  Fix problem when ${var} was on the first position.
  
  NOTE: I changed the code to use the same syntax as ant and most java
  programs - i.e. ${} instead of $(). Since we change most of the config
  format, I hope we can change this too, it was really odd.
  
  Revision  Changes    Path
  1.9       +12 -6     jakarta-tomcat-connectors/jk/native2/common/jk_config.c
  
  Index: jk_config.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_config.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- jk_config.c       9 Apr 2002 21:00:38 -0000       1.8
  +++ jk_config.c       11 Apr 2002 19:32:04 -0000      1.9
  @@ -58,7 +58,7 @@
   /***************************************************************************
    * Description: General purpose config object                                 *
    * Author:      Gal Shachor <[EMAIL PROTECTED]>                           *
  - * Version:     $Revision: 1.8 $                                           *
  + * Version:     $Revision: 1.9 $                                           *
    ***************************************************************************/
   
   #include "jk_global.h"
  @@ -266,6 +266,8 @@
        */
       val = jk2_config_replaceProperties(env, cfg->map, cfg->map->pool, val);
   
  +    /* fprintf( stderr, "config.setProperty2 %s %s %s \n", mbean->name, name, val 
); */
  +    
       /** Used for future replacements
        */
       cfg->map->add( env, cfg->map, pname, val );
  @@ -291,8 +293,8 @@
       int status;
       char *objName=NULL;
       char *propName=NULL;
  -
  -    /*     fprintf( stderr, "setPropertyString %s %s \n", name, value ); */
  +    
  +    /* fprintf( stderr, "setPropertyString %s %s \n", name, value ); */
   
       status=jk2_config_processBeanPropertyString(env, cfg, name, &objName, &propName 
);
       if( status!=JK_TRUE ) {
  @@ -720,8 +722,8 @@
       rc = value;
       env_start = value;
   
  -    while(env_start = strstr(env_start, "$(")) {
  -        char *env_end = strstr(env_start, ")");
  +    while(env_start = strstr(env_start, "${")) {
  +        char *env_end = strstr(env_start, "}");
           if( rec++ > 20 ) return rc;
           if(env_end) {
               char env_name[LENGTH_OF_LINE + 1] = ""; 
  @@ -742,7 +744,11 @@
                   if(!new_value) {
                       break;
                   }
  -                strncpy(new_value, rc, env_start-rc);
  +                if( env_start == rc ) {
  +                    new_value[0]='\0';
  +                } else {
  +                    strncpy(new_value, rc, env_start-rc);
  +                }
                   strcat(new_value, env_value);
                   strcat(new_value, env_end + 1);
                offset= env_start - rc + strlen( env_value );
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to