From: Jarkko Hietaniemi Date: Mon, 22 Oct 2001 20:10:40 +0000 (+0000) Subject: getpwuid() fragility continues. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=317fb1266314120941e0f6ac6394cca2dbc4ebae;p=p5sagit%2Fp5-mst-13.2.git getpwuid() fragility continues. p4raw-id: //depot/perl@12589 --- diff --git a/utils/h2xs.PL b/utils/h2xs.PL index 2a7b1c4..2b36af0 100644 --- a/utils/h2xs.PL +++ b/utils/h2xs.PL @@ -1052,12 +1052,14 @@ END my ($email,$author); eval { - my $user; - ($user,$author) = (getpwuid($>))[0,6]; - $author =~ s/,.*$//; # in case of sub fields - my $domain = $Config{'mydomain'}; - $domain =~ s/^\.//; - $email = "$user\@$domain"; + my $username; + ($username,$author) = (getpwuid($>))[0,6]; + if (defined $username && defined $author) { + $author =~ s/,.*$//; # in case of sub fields + my $domain = $Config{'mydomain'}; + $domain =~ s/^\.//; + $email = "$username\@$domain"; + } }; $author ||= "A. U. Thor";