Skip to content

Commit

Permalink
Environment should override /etc/papersize
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Oct 17, 2023
1 parent 95ceb03 commit 9b80ff4
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions gedcom
Original file line number Diff line number Diff line change
Expand Up @@ -741,14 +741,15 @@ if($opts{'S'} && $opts{'B'}) {
if($opts{'B'}) {
$pdf = PDF::API2->new(-file => $opts{'B'});
my $papersize;
if((-r '/etc/papersize') && open(my $fin, '<', '/etc/papersize')) { # Linux
$papersize = <$fin>;
close $fin;
chomp $papersize;
} elsif(defined($ENV{'LC_ALL'}) &&($ENV{'LC_ALL'} =~ /^en_US/)) {
if(defined($ENV{'LC_ALL'}) &&($ENV{'LC_ALL'} =~ /^en_US/)) {
$papersize = 'letter';
} elsif(defined($ENV{'LC_PAPER'}) &&($ENV{'LC_PAPER'} =~ /^en_US/)) {
$papersize = 'letter';
} elsif((-r '/etc/papersize') && open(my $fin, '<', '/etc/papersize')) {
# Linux
$papersize = <$fin>;
close $fin;
chomp $papersize;
} else {
$papersize = 'A4';
}
Expand Down

0 comments on commit 9b80ff4

Please sign in to comment.