Re: [PATCH] am: invoke perl's strftime in C locale
From: Jeff King <hidden>
Date: 2016-06-15 22:55:46
On Tue, Jan 15, 2013 at 12:59:33AM +0400, Dmitry V. Levin wrote:
quoted hunk ↗ jump to hunk
diff --git a/git-am.sh b/git-am.sh index c682d34..64b88e4 100755 --- a/git-am.sh +++ b/git-am.sh@@ -334,7 +334,7 @@ split_patches () { # Since we cannot guarantee that the commit message is in # git-friendly format, we put no Subject: line and just consume # all of the message as the body - perl -M'POSIX qw(strftime)' -ne 'BEGIN { $subject = 0 } + LC_ALL=C perl -M'POSIX qw(strftime)' -ne 'BEGIN { $subject = 0 } if ($subject) { print ; } elsif (/^\# User /) { s/\# User/From:/ ; print ; } elsif (/^\# Date /) {
This puts all of perl into the C locale, which would mean error messages from perl would be in English rather than the user's language. It probably isn't a big deal, because that snippet of perl is short and not likely to produce problems, but I wonder how hard it would be to set the locale just for the strftime call. -Peff