Skip to content

Commit

Permalink
Fix comments after module reference.
Browse files Browse the repository at this point in the history
	ok # foo!
  • Loading branch information
alandekok committed Oct 2, 2014
1 parent cf151d0 commit 2615fdf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 7 additions & 2 deletions src/main/conffile.c
Expand Up @@ -2244,7 +2244,13 @@ static int cf_section_read(char const *filename, int *lineno, FILE *fp,
break;
}

if (!*ptr || (*ptr == '#') || (*ptr == '}')) break;
if (!*ptr || (*ptr == '}')) break;

/*
* module # stuff!
* foo = bar # other stuff
*/
if ((t3 == T_HASH) || (*ptr == '#')) continue;

ERROR("%s[%d]: Syntax error: Expected comma after '%s': %s",
filename, *lineno, value, ptr);
Expand Down Expand Up @@ -2320,7 +2326,6 @@ static int cf_section_read(char const *filename, int *lineno, FILE *fp,
if (*ptr == '#') continue;

if (*ptr) {
DEBUG("XXXXX ::%s::\n", ptr);
goto get_more;
}

Expand Down
5 changes: 2 additions & 3 deletions src/tests/keywords/comments
Expand Up @@ -42,6 +42,5 @@ if (&request:Reply-Message[1] != "I am #literally a comment #") {
}
}

# @todo Fix these!
#ok # Im a comment after a module call
#ok # I'm a comment # after a module {} call
ok # I'm a comment after a module call
ok # I'm a comment # after a module {} call

0 comments on commit 2615fdf

Please sign in to comment.