]> git.ipfire.org Git - people/stevee/ipfire-2.x.git/commitdiff
wireguard-functions.pl: Remove any carriage returns on import
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 18 Jul 2025 09:57:34 +0000 (09:57 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 21 Jul 2025 09:26:06 +0000 (09:26 +0000)
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 <michael.tremer@ipfire.org>
config/cfgroot/wireguard-functions.pl

index f98cec40840d558b534c182e8e268fa16e4e8b37..1dc80f2c0d0b0034e97f9cb85e45f3d7937be374 100644 (file)
@@ -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;