From 054146ac007529580dbaf7d3fe9e60a42ea58027 Mon Sep 17 00:00:00 2001 From: Axel Burri Date: Mon, 6 Jun 2022 22:00:02 +0200 Subject: [PATCH] btrbk: keep quotes intact when removing comments in config --- btrbk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/btrbk b/btrbk index 95bc11f..7233a3c 100755 --- a/btrbk +++ b/btrbk @@ -4398,7 +4398,7 @@ sub parse_config($) open(FILE, '<', $file) or die $!; while () { 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