From e6667c15d366f58906c4e4db2b1f525e2f8695f9 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 10 Apr 2014 11:30:01 +0200 Subject: [PATCH] Support shell-style comments. Fixes #5994 --- doc/4.1-configuration-syntax.md | 4 ++-- lib/config/config_lexer.ll | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/4.1-configuration-syntax.md b/doc/4.1-configuration-syntax.md index 8c5ce5c54..0e2eeae5f 100644 --- a/doc/4.1-configuration-syntax.md +++ b/doc/4.1-configuration-syntax.md @@ -420,7 +420,7 @@ Non-empty dictionary | { key = "value" } | true ### Comments -The Icinga 2 configuration format supports C/C++-style comments. +The Icinga 2 configuration format supports C/C++-style and shell-style comments. Example: @@ -429,7 +429,7 @@ Example: */ object Host "localhost" { check_interval = 30 // this is also a comment. - retry_interval = 15 + retry_interval = 15 # yet another comment } ### Includes diff --git a/lib/config/config_lexer.ll b/lib/config/config_lexer.ll index 2663932a7..017affc0a 100644 --- a/lib/config/config_lexer.ll +++ b/lib/config/config_lexer.ll @@ -196,6 +196,7 @@ static char *lb_steal(lex_buf *lb) \/\/[^\n]* /* ignore C++-style comments */ +#[^\n]* /* ignore shell-style comments */ [ \t] /* ignore whitespace */ {