commit:     f783e065ed0bfba4432a435ae68274dd0f099087
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Fri Aug 22 06:22:42 2025 +0000
Commit:     Kerin Millar <kfm <AT> plushkava <DOT> net>
CommitDate: Fri Aug 22 22:24:29 2025 +0000
URL:        https://gitweb.gentoo.org/proj/locale-gen.git/commit/?id=f783e065

Specify the /n regex modifier where appropriate

There are two instances in which a regular expression incorporating
capturing parentheses is matched against, where nothing actually
requires capturing. Specify the /n modifier for these.

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

 locale-gen | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/locale-gen b/locale-gen
index 2c551ad..8bcbb05 100755
--- a/locale-gen
+++ b/locale-gen
@@ -333,7 +333,7 @@ sub parse_config ($fh, $path, $locale_by, $charmap_by) {
        while (my $line = readline $fh) {
                # 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*($|#)/;
+               next if $line =~ m/^\h*($|#)/n;
 
                # Permit comments trailing locale declarations.
                $line =~ s/\h\K#\h.*//;
@@ -565,7 +565,7 @@ sub run_localedef ($archive_prefix, @args) {
 sub fopen ($path, $mode = '<') {
        if (! open my $fh, $mode, $path) {
                die "$PROGRAM: Can't open '$path': $!\n";
-       } elsif (! -f $fh && canonpath($path) !~ m/^\/dev\/(null|stdin)\z/) {
+       } elsif (! -f $fh && canonpath($path) !~ m/^\/dev\/(null|stdin)\z/n) {
                die "$PROGRAM: Won't open '$path' because it is not a regular 
file\n";
        } else {
                return $fh;

Reply via email to