diff options
-rwxr-xr-x | localuserinfo | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/localuserinfo b/localuserinfo index 7c74589..a13b2b3 100755 --- a/localuserinfo +++ b/localuserinfo @@ -146,13 +146,12 @@ sub getuserinfo($) { my $gr = getgrgid($pw->gid) || die "Failed locating primary group of user \"$username\"."; my ($fullname, $office, $workphone, $homephone, $other) = split /\s*,\s*/, $pw->gecos; + $office .= ''; + $workphone .= ''; + $homephone .= ''; + $other .= ''; my @officehints = grep {s/^([\.[:alnum:]_-]+)$/%$1/} split /\s+/, $office; - my @addresshints; - if (defined($other)) { - @addresshints = grep {/^([\.[:alnum:]_-]+|\+)@([\.[:alnum:]_-]+)?$/} split /\s+/, $other; - } else { - $other = ""; - } + my @addresshints = grep {/^([\.[:alnum:]_-]+|\+)@([\.[:alnum:]_-]+)?$/} split /\s+/, $other; my $groupname = $gr->name; my $members = $gr->members; my $groups = join ' ', defined($groups{$username}) ? @{$groups{$username}} : ''; |