commit:     4cc290f31b36dcb4f2e27fe7ce773e68fe37efb2
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Sat Jan 10 01:36:29 2026 +0000
Commit:     Kerin Millar <kfm <AT> plushkava <DOT> net>
CommitDate: Sat Jan 10 01:36:29 2026 +0000
URL:        https://gitweb.gentoo.org/proj/locale-gen.git/commit/?id=4cc290f3

Chomp immediately after reading in parse_config()

This is only a matter of style. There are no behavioural changes.

Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>

 locale-gen | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/locale-gen b/locale-gen
index f2a6c65..1cf6a5c 100644
--- a/locale-gen
+++ b/locale-gen
@@ -365,15 +365,15 @@ sub parse_config ($fh, $path, $supported_by, $be_strict) {
        my $adjective = $be_strict ? 'Invalid' : 'Unsupported';
 
        while ($line = readline $fh) {
+               chomp $line;
+
                # Skip comments and blank lines. Note that \h will match only
                # " " and "\t", since the input stream is not being decoded.
-               next if $line =~ m/^\h*($|#)/n;
+               next if $line =~ m/^\h*(\z|#)/n;
 
                # Permit comments trailing locale declarations.
                $line =~ s/\h\K#\h.*//;
 
-               chomp $line;
-
                # A well-formed entry must contain either one or two fields. The
                # first defines the localename. The second defines the charmap.
                # If the second field is missing, a value of "UTF-8" is assumed.

Reply via email to