return 0;
}
+#ifndef SIG_PENDING_DIE_COUNT
+# define SIG_PENDING_DIE_COUNT 120
+#endif
+
static void
S_raise_signal(pTHX_ int sig)
{
/* Set a flag to say this signal is pending */
PL_psig_pend[sig]++;
/* And one to say _a_ signal is pending */
- PL_sig_pending = 1;
+ if (++PL_sig_pending >= SIG_PENDING_DIE_COUNT)
+ Perl_croak(aTHX_ "Maximal count of pending signals (%lu) exceeded",
+ (unsigned long)SIG_PENDING_DIE_COUNT);
}
Signal_t
if (!SvOK(sv))
return 0;
- if (SvFLAGS(sv) & SVp_SCREAM
- && (SvTYPE(sv) == SVt_PVGV || SvTYPE(sv) == SVt_PVGV)) {
+ if (isGV_with_GP(sv)) {
/* We're actually already a typeglob, so don't need the stuff below.
*/
return 0;
{
PERL_UNUSED_ARG(mg);
sv_unmagic(sv, PERL_MAGIC_bm);
+ SvTAIL_off(sv);
SvVALID_off(sv);
return 0;
}
}
else {
/* Shorter than original, will be padded. */
- Copy(s, PL_origargv[0], len, char);
- PL_origargv[0][len] = 0;
#ifdef PERL_DARWIN
- /* Special case for darwin: see [perl #38868] */
- memset(PL_origargv[0] + len + 1,
- (int)'\0', PL_origalen - len - 1);
+ /* Special case for Mac OS X: see [perl #38868] */
+ const int pad = 0;
#else
/* Is the space counterintuitive? Yes.
* (You were expecting \0?)
* Does it work? Seems to. (In Linux 2.4.20 at least.)
* --jhi */
- memset(PL_origargv[0] + len + 1,
- (int)' ', PL_origalen - len - 1);
+ const int pad = ' ';
#endif
+ Copy(s, PL_origargv[0], len, char);
+ PL_origargv[0][len] = 0;
+ memset(PL_origargv[0] + len + 1,
+ pad, PL_origalen - len - 1);
}
PL_origargv[0][PL_origalen-1] = 0;
for (i = 1; i < PL_origargc; i++)