diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2024-11-12 21:07:44 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2024-11-12 21:07:44 -0500 |
commit | f119e96e8fb7b752052930aac0daa4c0721d561d (patch) | |
tree | b179d91ba83f7bf432000cf55fed7d2340d273b5 /klippy/configfile.py | |
parent | 6d1256ddcc51cc62ab403fdc29d0b2688116a29e (diff) | |
download | kutter-f119e96e8fb7b752052930aac0daa4c0721d561d.tar.gz kutter-f119e96e8fb7b752052930aac0daa4c0721d561d.tar.xz kutter-f119e96e8fb7b752052930aac0daa4c0721d561d.zip |
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>
Diffstat (limited to 'klippy/configfile.py')
-rw-r--r-- | klippy/configfile.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/klippy/configfile.py b/klippy/configfile.py index 5d497c3d..8210de2b 100644 --- a/klippy/configfile.py +++ b/klippy/configfile.py @@ -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') |