--- mod_evhost.c.orig 2007-02-17 06:22:52.000000000 -0500 +++ mod_evhost.c 2007-05-25 15:18:57.403845000 -0400 @@ -87,9 +87,13 @@ s->path_pieces[s->len+1] = buffer_init(); buffer_copy_string_len(s->path_pieces[s->len],pos,ptr-pos); + if(*(ptr+2) == '.') { + pos = ptr + 4; + buffer_copy_string_len(s->path_pieces[s->len+1],ptr++,4); + } else { pos = ptr + 2; - buffer_copy_string_len(s->path_pieces[s->len+1],ptr++,2); + } s->len += 2; } @@ -287,6 +291,20 @@ if (*(ptr+1) == '%') { /* %% */ BUFFER_APPEND_STRING_CONST(p->tmp_buf,"%"); + } else if (*(ptr+2) == '.') { + /* dot notation in pattern, ie %3.1 insert 1st char of %3 */ + char key[3]; + int poffset = 0; + strncpy(key, p->conf.path_pieces[i]->ptr, 2); + key[2] = (char)NULL; + ds = (data_string *)array_get_element(parsed_host,key,1); + + /* check if the index is outside the string, indexing starts at 1 in config */ + poffset = atoi(ptr+3)-1; + + if (ds != NULL && (poffset >= 0 && poffset < ds->value->used)) { + buffer_append_string_len(p->tmp_buf,ds->value->ptr+poffset, 1); + } } else if (NULL != (ds = (data_string *)array_get_element(parsed_host, CONST_BUF_LEN(p->conf.path_pieces[i])))) { if (ds->value->used) { buffer_append_string_buffer(p->tmp_buf,ds->value);