summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--djgpp/djgpp.c19
-rw-r--r--lib/File/Spec.pm1
2 files changed, 20 insertions, 0 deletions
diff --git a/djgpp/djgpp.c b/djgpp/djgpp.c
index 4c53eb09c8..6aa290ec53 100644
--- a/djgpp/djgpp.c
+++ b/djgpp/djgpp.c
@@ -366,6 +366,24 @@ XS(dos_UseLFN)
XSRETURN_IV (_USE_LFN);
}
+XS(XS_Cwd_sys_cwd)
+{
+ dXSARGS;
+ if (items != 0)
+ Perl_croak_nocontext("Usage: Cwd::sys_cwd()");
+ {
+ char p[MAXPATHLEN];
+ char * RETVAL;
+ RETVAL = getcwd(p, MAXPATHLEN);
+ ST(0) = sv_newmortal();
+ sv_setpv((SV*)ST(0), RETVAL);
+#ifndef INCOMPLETE_TAINTS
+ SvTAINTED_on(ST(0));
+#endif
+ }
+ XSRETURN(1);
+}
+
void
Perl_init_os_extras(pTHX)
{
@@ -375,6 +393,7 @@ Perl_init_os_extras(pTHX)
newXS ("Dos::GetCwd",dos_GetCwd,file);
newXS ("Dos::UseLFN",dos_UseLFN,file);
+ newXS ("Cwd::sys_cwd",XS_Cwd_sys_cwd,file);
/* install my File System Extension for globbing */
__FSEXT_add_open_handler (glob_handler);
diff --git a/lib/File/Spec.pm b/lib/File/Spec.pm
index 3ac1060f0c..529e34fe84 100644
--- a/lib/File/Spec.pm
+++ b/lib/File/Spec.pm
@@ -11,6 +11,7 @@ my %module = (MacOS => 'Mac',
VMS => 'VMS',
epoc => 'Epoc',
NetWare => 'Win32', # Yes, File::Spec::Win32 works on NetWare.
+ dos => 'OS2', # Yes, File::Spec::OS2 works on DJGPP.
cygwin => 'Cygwin');