Some files might include carriage returns which won't be removed by
chomp() on Linux. To be extra safe, we remove them manually.

Signed-off-by: Michael Tremer <[email protected]>
---
 config/cfgroot/wireguard-functions.pl | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/config/cfgroot/wireguard-functions.pl 
b/config/cfgroot/wireguard-functions.pl
index f98cec408..1dc80f2c0 100644
--- a/config/cfgroot/wireguard-functions.pl
+++ b/config/cfgroot/wireguard-functions.pl
@@ -488,6 +488,9 @@ sub parse_configuration($$) {
                # Remove line breaks
                chomp;
 
+               # Remove any carriage returns
+               $_ =~ s/\r$//;
+
                # Search for section headers
                if ($_ =~ m/^\[(\w+)\]$/) {
                        $section = $1;
-- 
2.39.5


Reply via email to