[pve-devel] [PATCH cluster 1/4] parse datacenter config: remove "\s*" from comment regex

Stefan Sterz s.sterz at proxmox.com
Thu Feb 24 15:21:48 CET 2022


To be consistent with PBS's implementation of multi-line comments
remove "\s*" here too. Since the regex isn't lazy .* matches
everything \s* would anyway. (Note that new lines occurs after "$").

Signed-off-by: Stefan Sterz <s.sterz at proxmox.com>
---
 data/PVE/DataCenterConfig.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/data/PVE/DataCenterConfig.pm b/data/PVE/DataCenterConfig.pm
index 6c0fa5b..8e51ba3 100644
--- a/data/PVE/DataCenterConfig.pm
+++ b/data/PVE/DataCenterConfig.pm
@@ -236,7 +236,7 @@ sub parse_datacenter_config {
     # description may be comment or key-value pair (or both)
     my $comment = '';
     for my $line (split(/\n/, $raw)) {
-	if ($line =~ /^\#(.*)\s*$/) {
+	if ($line =~ /^\#(.*)$/) {
 	    $comment .= PVE::Tools::decode_text($1) . "\n";
 	}
     }
-- 
2.30.2






More information about the pve-devel mailing list