Skip to content

Commit

Permalink
Add support for comments in the middle of the line in ACL files
Browse files Browse the repository at this point in the history
  • Loading branch information
Mygod authored and Noisyfox committed Feb 1, 2017
1 parent 5c381d4 commit 6851294
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,13 +396,12 @@ init_acl(const char *path)
buf[len - 1] = '\0';
}

char *line = trimwhitespace(buf);

// Skip comments
if (line[0] == '#') {
continue;
char *comment = strchr(buf, '#');
if (comment) {
*comment = '\0';
}

char *line = trimwhitespace(buf);
if (strlen(line) == 0) {
continue;
}
Expand Down

0 comments on commit 6851294

Please sign in to comment.