Index: src/mod_evhost.c =================================================================== --- src/mod_evhost.c (revision 1858) +++ src/mod_evhost.c (working copy) @@ -83,9 +83,14 @@ s->path_pieces[s->len+1] = buffer_init(); buffer_copy_string_len(s->path_pieces[s->len],pos,ptr-pos); - pos = ptr + 2; - buffer_copy_string_len(s->path_pieces[s->len+1],ptr++,2); + 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 +292,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] = NULL; + ds = (data_string *)array_get_element(parsed_host,key); + + /* 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,p->conf.path_pieces[i]->ptr))) { if (ds->value->used) { buffer_append_string_buffer(p->tmp_buf,ds->value);