summaryrefslogtreecommitdiff
path: root/universal.c
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2019-03-25 16:48:40 +1100
committerTony Cook <tony@develop-help.com>2019-04-15 09:26:29 +1000
commit15f67d146cf1f32504e8a11de3faa2abc0f467cd (patch)
treea92ea69f7e00458ecd05a965bb356287fdd572c7 /universal.c
parent05fed879afada2f6ac1f1b5b6962e06190f5b9f6 (diff)
downloadperl-15f67d146cf1f32504e8a11de3faa2abc0f467cd.tar.gz
(perl #133951) add Internals::getcwd
Diffstat (limited to 'universal.c')
-rw-r--r--universal.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/universal.c b/universal.c
index c1b5dd4b14..66eafc5c3d 100644
--- a/universal.c
+++ b/universal.c
@@ -986,6 +986,25 @@ XS(XS_re_regexp_pattern)
NOT_REACHED; /* NOTREACHED */
}
+#ifdef HAS_GETCWD
+
+XS(XS_Internals_getcwd)
+{
+ dXSARGS;
+ 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"
@@ -1020,6 +1039,9 @@ static const struct xsub_details these_details[] = {
{"re::regnames", XS_re_regnames, ";$"},
{"re::regnames_count", XS_re_regnames_count, ""},
{"re::regexp_pattern", XS_re_regexp_pattern, "$"},
+#ifdef HAS_GETCWD
+ {"Internals::getcwd", XS_Internals_getcwd, ""},
+#endif
};
STATIC OP*