mirror of https://github.com/digint/btrbk
btrbk: keep quotes intact when removing comments in config
parent
9d21785778
commit
054146ac00
2
btrbk
2
btrbk
|
@ -4398,7 +4398,7 @@ sub parse_config($)
|
||||||
open(FILE, '<', $file) or die $!;
|
open(FILE, '<', $file) or die $!;
|
||||||
while (<FILE>) {
|
while (<FILE>) {
|
||||||
chomp;
|
chomp;
|
||||||
s/#.*//; # remove comments # TODO fixme within quotes
|
s/((?:[^"'#]*(?:"[^"]*"|'[^']*'))*[^"'#]*)#.*/$1/; # remove comments
|
||||||
next if /^\s*$/; # ignore empty lines
|
next if /^\s*$/; # ignore empty lines
|
||||||
s/^\s*//; # remove leading whitespace
|
s/^\s*//; # remove leading whitespace
|
||||||
s/\s*$//; # remove trailing whitespace
|
s/\s*$//; # remove trailing whitespace
|
||||||
|
|
Loading…
Reference in New Issue