commit: d6804a064b4ebce70cd18294f8e657f09247cdaf
Author: Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Fri Jan 9 04:16:44 2026 +0000
Commit: Kerin Millar <kfm <AT> plushkava <DOT> net>
CommitDate: Fri Jan 9 04:16:44 2026 +0000
URL: https://gitweb.gentoo.org/proj/locale-gen.git/commit/?id=d6804a06
Constrain the scope of DIR in check_archive_dir()
It would make more sense to set the 'DIR' environment variable within
the same lexical scope that the 'LC_ALL' variable is. Make it so.
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 0e68f32..37d848f 100644
--- a/locale-gen
+++ b/locale-gen
@@ -430,11 +430,11 @@ sub parse_config ($fh, $path, $supported_by, $be_strict) {
}
sub check_archive_dir ($prefix, $locale_dir) {
- my $archive_dir = local $ENV{'DIR'} = catdir($prefix, $locale_dir);
+ my $archive_dir = catdir($prefix, $locale_dir);
# Quietly attempt to create the directory if it does not already exist.
{
- local $ENV{'LC_ALL'} = 'C';
+ local @ENV{'LC_ALL', 'DIR'} = ('C', $archive_dir);
system q{ mkdir -p -- "$DIR" 2>/dev/null };
}