|
|
|
@ -87,8 +87,8 @@ static excludes_buffer *excludes_buffer_init(void) {
|
|
|
|
|
return exb; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static int excludes_buffer_append(excludes_buffer *exb, buffer *string) { |
|
|
|
|
#ifdef HAVE_PCRE_H |
|
|
|
|
static int excludes_buffer_append(excludes_buffer *exb, buffer *string) { |
|
|
|
|
size_t i; |
|
|
|
|
const char *errptr; |
|
|
|
|
int erroff; |
|
|
|
@ -126,13 +126,8 @@ static int excludes_buffer_append(excludes_buffer *exb, buffer *string) {
|
|
|
|
|
exb->used++; |
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
|
#else |
|
|
|
|
UNUSED(exb); |
|
|
|
|
UNUSED(string); |
|
|
|
|
|
|
|
|
|
return -1; |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
static void excludes_buffer_free(excludes_buffer *exb) { |
|
|
|
|
#ifdef HAVE_PCRE_H |
|
|
|
@ -291,7 +286,6 @@ SETDEFAULTS_FUNC(mod_dirlisting_set_defaults) {
|
|
|
|
|
|
|
|
|
|
if (NULL != (du_excludes = array_get_element(config->value, CONFIG_EXCLUDE))) { |
|
|
|
|
array *excludes_list; |
|
|
|
|
size_t j; |
|
|
|
|
|
|
|
|
|
excludes_list = ((data_array*)du_excludes)->value; |
|
|
|
|
|
|
|
|
@ -308,7 +302,7 @@ SETDEFAULTS_FUNC(mod_dirlisting_set_defaults) {
|
|
|
|
|
return HANDLER_ERROR; |
|
|
|
|
} |
|
|
|
|
#else |
|
|
|
|
for (j = 0; j < excludes_list->used; j++) { |
|
|
|
|
for (size_t j = 0; j < excludes_list->used; ++j) { |
|
|
|
|
data_unset *du_exclude = excludes_list->data[j]; |
|
|
|
|
|
|
|
|
|
if (du_exclude->type != TYPE_STRING) { |
|
|
|
@ -967,7 +961,9 @@ static int http_list_directory(server *srv, connection *con, plugin_data *p, buf
|
|
|
|
|
files.used = 0; |
|
|
|
|
|
|
|
|
|
while ((dent = readdir(dp)) != NULL) { |
|
|
|
|
#ifdef HAVE_PCRE_H |
|
|
|
|
unsigned short exclude_match = 0; |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
if (dent->d_name[0] == '.') { |
|
|
|
|
if (hide_dotfiles) |
|
|
|
|