From: Jarkko Hietaniemi Date: Tue, 2 May 2000 17:41:24 +0000 (+0000) Subject: Call getspnam() only iff needed. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5cdabb00637dac511820ef15cf49e86f5e883771;p=p5sagit%2Fp5-mst-13.2.git Call getspnam() only iff needed. p4raw-id: //depot/cfgperl@6047 --- diff --git a/pp_sys.c b/pp_sys.c index 765b0bc..2f67483 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -4793,11 +4793,6 @@ PP(pp_gpwent) break; } -# ifdef HAS_GETSPNAM - if (GIMME != G_ARRAY && pwent) - spwent = getspnam(pwent->pw_name); -# endif - EXTEND(SP, 10); if (GIMME != G_ARRAY) { PUSHs(sv = sv_newmortal()); @@ -4820,12 +4815,13 @@ PP(pp_gpwent) PUSHs(sv = sv_mortalcopy(&PL_sv_no)); # ifdef HAS_GETSPNAM - if (spwent) - sv_setpv(sv, spwent->sp_pwdp); - else - sv_setpv(sv, pwent->pw_passwd); + spwent = getspnam(pwent->pw_name); + if (spwent) + sv_setpv(sv, spwent->sp_pwdp); + else + sv_setpv(sv, pwent->pw_passwd); # else - sv_setpv(sv, pwent->pw_passwd); + sv_setpv(sv, pwent->pw_passwd); # endif # ifndef INCOMPLETE_TAINTS /* passwd is tainted because user himself can diddle with it. */