tmps = SvPV(TOPs, na);
}
if (!tmps || !*tmps) {
- (void)SvUPGRADE(ERRSV, SVt_PV);
- if (SvPOK(ERRSV) && SvCUR(ERRSV))
- sv_catpv(ERRSV, "\t...caught");
- tmps = SvPV(ERRSV, na);
+ SV *error = ERRSV;
+ (void)SvUPGRADE(error, SVt_PV);
+ if (SvPOK(error) && SvCUR(error))
+ sv_catpv(error, "\t...caught");
+ tmps = SvPV(error, na);
}
if (!tmps || !*tmps)
tmps = "Warning: something's wrong";
{
djSP; dMARK;
char *tmps;
+ SV *tmpsv = Nullsv;
+ char *pat = "%s";
if (SP - MARK != 1) {
dTARGET;
do_join(TARG, &sv_no, MARK, SP);
SP = MARK + 1;
}
else {
- tmps = SvPV(TOPs, na);
+ tmpsv = TOPs;
+ tmps = SvROK(tmpsv) ? Nullch : SvPV(tmpsv, na);
}
if (!tmps || !*tmps) {
- (void)SvUPGRADE(ERRSV, SVt_PV);
- if (SvPOK(ERRSV) && SvCUR(ERRSV))
- sv_catpv(ERRSV, "\t...propagated");
- tmps = SvPV(ERRSV, na);
+ SV *error = ERRSV;
+ (void)SvUPGRADE(error, SVt_PV);
+ if(tmpsv ? SvROK(tmpsv) : SvROK(error)) {
+ if(tmpsv)
+ SvSetSV(error,tmpsv);
+ pat = Nullch;
+ }
+ else {
+ if (SvPOK(error) && SvCUR(error))
+ sv_catpv(error, "\t...propagated");
+ tmps = SvPV(error, na);
+ }
}
if (!tmps || !*tmps)
tmps = "Died";
- DIE("%s", tmps);
+ DIE(pat, tmps);
}
/* I/O. */
TAINT_PROPER("umask");
XPUSHi(anum);
#else
- DIE(no_func, "Unsupported function umask");
+ XPUSHs(&sv_undef)
#endif
RETURN;
}
if (pwent) {
PUSHs(sv = sv_mortalcopy(&sv_no));
sv_setpv(sv, pwent->pw_name);
+
PUSHs(sv = sv_mortalcopy(&sv_no));
sv_setpv(sv, pwent->pw_passwd);
+
PUSHs(sv = sv_mortalcopy(&sv_no));
sv_setiv(sv, (IV)pwent->pw_uid);
+
PUSHs(sv = sv_mortalcopy(&sv_no));
sv_setiv(sv, (IV)pwent->pw_gid);
+
+ /* pw_change, pw_quota, and pw_age are mutually exclusive. */
PUSHs(sv = sv_mortalcopy(&sv_no));
#ifdef PWCHANGE
sv_setiv(sv, (IV)pwent->pw_change);
#else
-#ifdef PWQUOTA
+# ifdef PWQUOTA
sv_setiv(sv, (IV)pwent->pw_quota);
-#else
-#ifdef PWAGE
+# else
+# ifdef PWAGE
sv_setpv(sv, pwent->pw_age);
+# endif
+# endif
#endif
-#endif
-#endif
+
+ /* pw_class and pw_comment are mutually exclusive. */
PUSHs(sv = sv_mortalcopy(&sv_no));
#ifdef PWCLASS
sv_setpv(sv, pwent->pw_class);
#else
-#ifdef PWCOMMENT
+# ifdef PWCOMMENT
sv_setpv(sv, pwent->pw_comment);
+# endif
#endif
-#endif
+
PUSHs(sv = sv_mortalcopy(&sv_no));
+#ifdef PWGECOS
sv_setpv(sv, pwent->pw_gecos);
+#endif
#ifndef INCOMPLETE_TAINTS
+ /* pw_gecos is tainted. */
SvTAINTED_on(sv);
#endif
+
PUSHs(sv = sv_mortalcopy(&sv_no));
sv_setpv(sv, pwent->pw_dir);
+
PUSHs(sv = sv_mortalcopy(&sv_no));
sv_setpv(sv, pwent->pw_shell);
+
#ifdef PWEXPIRE
PUSHs(sv = sv_mortalcopy(&sv_no));
sv_setiv(sv, (IV)pwent->pw_expire);