mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-10-26 07:46:11 +01:00
configfile: Fix comments on same line as [include xxx.cfg] directive
Commit 9d4ab862 broke support for '#' style comments on the same line
as [include] config directives. Fix by adding back in the check for
comments in _parse_config().
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
@@ -209,6 +209,10 @@ class ConfigFileReader:
|
||||
# in includes apply linearly as they do within a single file
|
||||
buf = []
|
||||
for line in lines:
|
||||
# Strip trailing comment
|
||||
pos = line.find('#')
|
||||
if pos >= 0:
|
||||
line = line[:pos]
|
||||
# Process include or buffer line
|
||||
mo = configparser.RawConfigParser.SECTCRE.match(line)
|
||||
header = mo and mo.group('header')
|
||||
|
||||
Reference in New Issue
Block a user