diff --git a/src/acl.c b/src/acl.c index 60d4b727..d790f401 100644 --- a/src/acl.c +++ b/src/acl.c @@ -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; }