List Info

Thread: Bugfixes




Bugfixes
user name
2006-12-26 01:08:05
This patch:

 a) Makes _perl_abs_path() support systems with drive
letters (enabled
    on OS/2 only, but must be enabled on other DOSISH
systems too; if
    this test "works" on DOSISH systems, it is a
bug in abs_path(),
    since when applied to 'd:', it should better give the
*current*
    directory of d:, not the root directory of d:  ...)

 b) Puts a workaround for auto-vivication Perl bug
(triggered by
    OS/2-specific code);

 c) fixes a test with inverted ok() arguments in cwd.t;

 d) the same test, if failing, would stop proceeding with
other tests;

Thanks to the module maintainers (at least for a very strict
test suite ,
Ilya

P.S.  Still, I'm not convinced that the test mentioned in
"c" and "d"
      (see the last chunk below) is reasonable (btw, it
breaks on
      OS/2).

      Newer File::Path does not mention cwd() at all;
anyway, why test
      for conditions which are triggered by BUGS in
something else?

--- ./Cwd.pm-pre	Thu Apr 27 20:02:16 2006
+++ ./Cwd.pm	Mon Dec 25 16:57:50 2006
 -525,7
+525,8  sub _perl_abs_path
 	    
 	    return abs_path($link_target);
 	}
-	
+
+	$dir .= '/.' if $^O eq 'os2' and $dir =~ /^[a-z]:$/i;
 	return $dir ? abs_path($dir) . "/$file" :
"/$file";
     }
 
--- ./lib/File/Spec/OS2.pm-pre	Thu Apr 27 20:02:16 2006
+++ ./lib/File/Spec/OS2.pm	Mon Dec 25 16:44:44 2006
 -37,9
+37,8  sub _cwd {
 my $tmpdir;
 sub tmpdir {
     return $tmpdir if defined $tmpdir;
-    $tmpdir = $_[0]->_tmpdir( ENV{qw(TMPDIR TEMP TMP)},
-			      '/tmp',
-			      '/'  );
+    my d = ENV{qw(TMPDIR TEMP TMP)};	# function call could
autovivivy
+    $tmpdir = $_[0]->_tmpdir( d, '/tmp', '/'  );
 }
 
 sub catdir {
--- ./t/cwd.t-pre	Thu Apr 27 20:02:16 2006
+++ ./t/cwd.t	Mon Dec 25 16:47:28 2006
 -129,7
+129,7  foreach my $func (qw(cwd getcwd fastcwd 
   # Some versions of File::Path (e.g. that shipped with
perl 5.8.5)
   # call getcwd() with an argument (perhaps by calling it
as a
   # method?), so make sure that doesn't die.
-  is getcwd(), getcwd('foo'), "Call getcwd() with an
argument";
+  is eval {getcwd('foo')}, getcwd(), "Call getcwd()
with an argument";
 }
 
 # Cwd::chdir should also update $ENV
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )