diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-10-22 20:10:40 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-10-22 20:10:40 +0000 |
commit | 317fb1266314120941e0f6ac6394cca2dbc4ebae (patch) | |
tree | 2d1aacc638de4ec80e9f1b557488d5c8b6b454fb /utils | |
parent | c44feae73a9ab8dd587fbb4994f81bc46dd2f1d9 (diff) | |
download | perl-317fb1266314120941e0f6ac6394cca2dbc4ebae.tar.gz |
getpwuid() fragility continues.
p4raw-id: //depot/perl@12589
Diffstat (limited to 'utils')
-rw-r--r-- | utils/h2xs.PL | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/utils/h2xs.PL b/utils/h2xs.PL index 2a7b1c42e1..2b36af042f 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"; |