NOT_REACHED; /* NOTREACHED */
}
-XS(XS_Regexp_smartmatch); /* prototype to pass -Wmissing-prototypes */
-XS(XS_Regexp_smartmatch)
+#ifdef HAS_GETCWD
+
+XS(XS_Internals_getcwd)
{
dXSARGS;
- SV *regexp_sv, *matchee_sv;
- REGEXP *rx;
- regexp *prog;
- const char *strstart, *strend;
- STRLEN len;
-
- if (items != 3)
- croak_xs_usage(cv, "regexp, matchee, swap");
- matchee_sv = SP[-1];
- regexp_sv = SP[-2];
- SP -= 2;
- PUTBACK;
- assert(SvROK(regexp_sv));
- rx = (REGEXP*)SvRV(regexp_sv);
- assert(SvTYPE((SV*)rx) == SVt_REGEXP);
- prog = ReANY(rx);
- strstart = SvPV_const(matchee_sv, len);
- assert(strstart);
- strend = strstart + len;
- TOPs = boolSV((RXp_MINLEN(prog) < 0 || len >= (STRLEN)RXp_MINLEN(prog)) &&
- CALLREGEXEC(rx, (char*)strstart, (char *)strend,
- (char*)strstart, 0, matchee_sv, NULL, 0));
+ SV *sv = sv_newmortal();
+
+ if (items != 0)
+ croak_xs_usage(cv, "");
+
+ (void)getcwd_sv(sv);
+
+ SvTAINTED_on(sv);
+ PUSHs(sv);
+ XSRETURN(1);
}
+#endif
+
#include "vutil.h"
#include "vxs.inc"
const char *proto;
};
-static const struct xsub_details details[] = {
+static const struct xsub_details these_details[] = {
{"UNIVERSAL::isa", XS_UNIVERSAL_isa, NULL},
{"UNIVERSAL::can", XS_UNIVERSAL_can, NULL},
{"UNIVERSAL::DOES", XS_UNIVERSAL_DOES, NULL},
{"re::regnames", XS_re_regnames, ";$"},
{"re::regnames_count", XS_re_regnames_count, ""},
{"re::regexp_pattern", XS_re_regexp_pattern, "$"},
- {"Regexp::((", XS_Regexp_smartmatch, NULL},
- {"Regexp::()", XS_Regexp_smartmatch, NULL},
- {"Regexp::(~~", XS_Regexp_smartmatch, NULL},
+#ifdef HAS_GETCWD
+ {"Internals::getcwd", XS_Internals_getcwd, ""},
+#endif
};
STATIC OP*
Perl_boot_core_UNIVERSAL(pTHX)
{
static const char file[] = __FILE__;
- const struct xsub_details *xsub = details;
- const struct xsub_details *end = C_ARRAY_END(details);
+ const struct xsub_details *xsub = these_details;
+ const struct xsub_details *end = C_ARRAY_END(these_details);
do {
newXS_flags(xsub->name, xsub->xsub, file, xsub->proto, 0);
*cvfile = (char *)file;
Safefree(oldfile);
}
-
- /* overload fallback flag for Regexp */
- sv_setiv(get_sv("Regexp::()", GV_ADD), 1);
}
/*