}
sv_setpv(PL_statname, SvPV(sv,n_a));
PL_statgv = Nullgv;
-#ifdef HAS_LSTAT
PL_laststype = PL_op->op_type;
if (PL_op->op_type == OP_LSTAT)
PL_laststatval = PerlLIO_lstat(SvPV(PL_statname, n_a), &PL_statcache);
else
-#endif
PL_laststatval = PerlLIO_stat(SvPV(PL_statname, n_a), &PL_statcache);
if (PL_laststatval < 0) {
if (ckWARN(WARN_NEWLINE) && strchr(SvPV(PL_statname, n_a), '\n'))
use Config;
use File::Spec;
-plan tests => 78;
+plan tests => 80;
my $Perl = which_perl();
my @r = \stat($Curdir);
is(scalar @r, 13, 'stat returns full 13 elements');
+stat $0;
+eval { lstat _ };
+like( $@, qr/^The stat preceding lstat\(\) wasn't an lstat/,
+ 'lstat _ croaks after stat' );
+eval { -l _ };
+like( $@, qr/^The stat preceding -l _ wasn't an lstat/,
+ '-l _ croaks after stat' );
+
+lstat $0;
+eval { lstat _ };
+is( "$@", "", "lstat _ ok after lstat" );
+eval { -l _ };
+is( "$@", "", "-l _ ok after lstat" );
+
SKIP: {
- skip "No lstat", 4 unless $Config{d_lstat};
-
- stat $0;
- eval { lstat _ };
- like( $@, qr/^The stat preceding lstat\(\) wasn't an lstat/,
- 'lstat _ croaks after stat' );
- eval { -l _ };
- like( $@, qr/^The stat preceding -l _ wasn't an lstat/,
- '-l _ croaks after stat' );
+ skip "No lstat", 2 unless $Config{d_lstat};
# bug id 20020124.004
# If we have d_lstat, we should have symlink()