From: Yitzchak Scott-Thoennes Date: Mon, 20 Dec 2004 16:08:56 +0000 (-0800) Subject: Re: [PATCH] File::Find dies on find({follow=>1, ...}) on Win32 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=049f818b9a6d0ed6efed5c49515a9d137e475267;p=p5sagit%2Fp5-mst-13.2.git Re: [PATCH] File::Find dies on find({follow=>1, ...}) on Win32 Message-ID: <20041221000856.GA2924@efn.org> p4raw-id: //depot/perl@23842 --- diff --git a/pp_sys.c b/pp_sys.c index d848f73..0bb7165 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -2846,12 +2846,10 @@ PP(pp_stat) } 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')) diff --git a/t/op/stat.t b/t/op/stat.t index 6afbadc..c553a16 100755 --- a/t/op/stat.t +++ b/t/op/stat.t @@ -9,7 +9,7 @@ BEGIN { use Config; use File::Spec; -plan tests => 78; +plan tests => 80; my $Perl = which_perl(); @@ -406,16 +406,22 @@ unlink $tmpfile or print "# unlink failed: $!\n"; 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()