This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: [PATCH 5.8.1 @20218] OS/2 API
authorIlya Zakharevich <ilya@math.berkeley.edu>
Sat, 13 Sep 2003 20:20:30 +0000 (13:20 -0700)
committerJarkko Hietaniemi <jhi@iki.fi>
Sun, 14 Sep 2003 06:46:26 +0000 (06:46 +0000)
Message-ID: <20030914032030.GA17822@math.berkeley.edu>

p4raw-id: //depot/perl@21219

os2/os2.c
t/run/switches.t

index bf8891b..ddb5895 100644 (file)
--- a/os2/os2.c
+++ b/os2/os2.c
@@ -2949,11 +2949,11 @@ XS(XS_Cwd_sys_cwd)
 XS(XS_Cwd_sys_abspath)
 {
     dXSARGS;
-    if (items < 1 || items > 2)
-       Perl_croak_nocontext("Usage: Cwd::sys_abspath(path, dir = NULL)");
+    if (items > 2)
+       Perl_croak_nocontext("Usage: Cwd::sys_abspath(path = '.', dir = NULL)");
     {
        STRLEN n_a;
-       char *  path = (char *)SvPV(ST(0),n_a);
+       char *  path = items ? (char *)SvPV(ST(0),n_a) : ".";
        char *  dir, *s, *t, *e;
        char p[MAXPATHLEN];
        char *  RETVAL;
@@ -3073,6 +3073,10 @@ XS(XS_Cwd_sys_abspath)
            *t = 0;
            SvCUR_set(sv, t - SvPVX(sv));
        }
+#ifndef INCOMPLETE_TAINTS
+       if (!items)
+           SvTAINTED_on(ST(0));
+#endif
     }
     XSRETURN(1);
 }
index 20d8d69..1c904d4 100644 (file)
@@ -231,7 +231,7 @@ SWTESTPM
     local $TODO = '';   # these ones should work on VMS
 
     like( runperl( switches => ['-h'] ),
-         qr/Usage: .+perl.+switches.+programfile.+arguments/,
+         qr/Usage: .+(?i:perl(\.exe)?).+switches.+programfile.+arguments/,
           '-h looks okay' );
 
 }