public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
From: Michael Tremer <michael.tremer@ipfire.org>
To: development@lists.ipfire.org
Cc: Michael Tremer <michael.tremer@ipfire.org>
Subject: [PATCH] wireguard-functions.pl: Remove any carriage returns on import
Date: Fri, 18 Jul 2025 09:57:34 +0000	[thread overview]
Message-ID: <20250718095734.1042987-1-michael.tremer@ipfire.org> (raw)

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(+)

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	other threads:[~2025-07-18  9:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250718095734.1042987-1-michael.tremer@ipfire.org \
    --to=michael.tremer@ipfire.org \
    --cc=development@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox