Mercurial > make_username
changeset 9:807d649f3bc9 tip
Tinker, tinker, nothing major.
author | Eris Caffee <discordia@eldalin.com> |
---|---|
date | Mon, 18 Jul 2011 13:24:25 -0500 |
parents | 542b1fb6759d |
children | |
files | make-username.pl |
diffstat | 1 files changed, 4 insertions(+), 6 deletions(-) [+] |
line diff
1.1 --- a/make-username.pl Mon Jul 18 13:08:21 2011 -0500 1.2 +++ b/make-username.pl Mon Jul 18 13:24:25 2011 -0500 1.3 @@ -135,18 +135,16 @@ 1.4 $base = "user"; 1.5 } 1.6 1.7 - ! defined $pwdfile and $pwdfile = "/etc/passwd"; 1.8 - 1.9 if (! defined $maxlen) { 1.10 $maxlen = 8; 1.11 - } else { 1.12 - if ($maxlen !~ /^\d+$/) { 1.13 + } elsif ($maxlen !~ /^\d+$/) { 1.14 printf(STDERR "Error: non-numeric username length specified.\n"); 1.15 return undef; 1.16 - } 1.17 } 1.18 1.19 - if (! -e $pwdfile) { 1.20 + if (! defined $pwdfile) { 1.21 + $pwdfile = "/etc/passwd"; 1.22 + } elsif (! -e $pwdfile) { 1.23 printf(STDERR "Error: non-existant passwd file specified: $pwdfile\n"); 1.24 return undef; 1.25 }