Skip to content

Commit

Permalink
Add documentation for the mongoose binary
Browse files Browse the repository at this point in the history
    PUBLISHED_FROM=71a01298c9bbff9a748ea33e0d148d549e5e6437
  • Loading branch information
cpq committed Nov 30, 2015
1 parent 7951dac commit e9d79b1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mongoose.c
Original file line number Diff line number Diff line change
Expand Up @@ -5016,6 +5016,13 @@ static int is_file_hidden(const char *path,
const struct mg_serve_http_opts *opts) {
const char *p1 = opts->per_directory_auth_file;
const char *p2 = opts->hidden_file_pattern;

/* Strip directory path from the file name */
const char *pdir = strrchr(path, DIRSEP);
if (pdir != NULL) {
path = pdir + 1;
}

return !strcmp(path, ".") || !strcmp(path, "..") ||
(p1 != NULL && !strcmp(path, p1)) ||
(p2 != NULL && mg_match_prefix(p2, strlen(p2), path) > 0);
Expand Down

0 comments on commit e9d79b1

Please sign in to comment.