btrbk: keep quotes intact when removing comments in config

pull/485/head
Axel Burri 2022-06-06 22:00:02 +02:00
parent 9d21785778
commit 054146ac00
1 changed files with 1 additions and 1 deletions

2
btrbk
View File

@ -4398,7 +4398,7 @@ sub parse_config($)
open(FILE, '<', $file) or die $!;
while (<FILE>) {
chomp;
s/#.*//; # remove comments # TODO fixme within quotes
s/((?:[^"'#]*(?:"[^"]*"|'[^']*'))*[^"'#]*)#.*/$1/; # remove comments
next if /^\s*$/; # ignore empty lines
s/^\s*//; # remove leading whitespace
s/\s*$//; # remove trailing whitespace