diff options
author | David Barksdale <amatus.amongus@gmail.com> | 2011-09-12 17:44:47 -0500 |
---|---|---|
committer | David Barksdale <amatus.amongus@gmail.com> | 2011-09-12 17:44:47 -0500 |
commit | 9fb1af76244804a0eaed6ffe7ae17a5fca40b30c (patch) | |
tree | 8ab542dbedd12cd70eca0ba5fea4f0f0f3854c4f /src/storage | |
parent | 2b4fef03d137675c1ab3519f921643f195967ed2 (diff) |
Skip over dot-files.
Diffstat (limited to 'src/storage')
-rw-r--r-- | src/storage/main.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/storage/main.c b/src/storage/main.c index cfa1006..7c3c499 100644 --- a/src/storage/main.c +++ b/src/storage/main.c @@ -166,6 +166,10 @@ again: return MHD_CONTENT_READER_END_WITH_ERROR; } if( NULL != de ) { + if( '.' == de->d_name[0] ) { + free(mem); + goto again; + } path = strprintf("%s/%s", s->e_hnk_path, de->d_name); if( NULL == path ) { free(mem); @@ -214,6 +218,10 @@ again: return MHD_CONTENT_READER_END_WITH_ERROR; } if( NULL != de ) { + if( '.' == de->d_name[0] ) { + free(mem); + goto again; + } path = strprintf("%s/%s/%c%c/%s", s->server_path, de->d_name, s->e_hnk[0], s->e_hnk[1], &s->e_hnk[2]); if( NULL == path ) { @@ -257,7 +265,7 @@ static int dh(void *cls, struct MHD_Connection *connection, status_code = MHD_HTTP_NOT_FOUND; goto err; } - if( strlen(s->e_hnk) < 3 ) { + if( strlen(s->e_hnk) < 3 || '.' == s->e_hnk[0] ) { free_read_blocks_state(s); status_code = MHD_HTTP_NOT_FOUND; goto err; |