wireguard-functions.pl: Remove any carriage returns on import
Commit Message
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 | 3 +++
1 file changed, 3 insertions(+)
@@ -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;