Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Commit

Permalink
File::Spec::Win32: relax str types
Browse files Browse the repository at this point in the history
because some take stringified File::Temp::Dir arguments.

Type of arg @p to File::Spec::Win32::catfile should be str (not
 File::Temp::Dir) at ../../lib/File/Spec/Functions.pm line 60.
Type of arg $first to File::Spec::Win32::_canon_cat should be str (not
 File::Temp::Dir) at ../../lib/File/Spec/Win32.pm line 142.
  • Loading branch information
rurban committed Jul 1, 2019
1 parent 5830ac8 commit f8515f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .git-rr-cache
Submodule .git-rr-cache updated 33 files
+3,905 −0 0465c7c75b3f335c15f3c08104bb1324ba8941ab/postimage
+3,908 −0 0465c7c75b3f335c15f3c08104bb1324ba8941ab/preimage
+3,908 −0 0465c7c75b3f335c15f3c08104bb1324ba8941ab/thisimage
+3,906 −0 1c18e31e0f5fa279862429a79e3520301415588c/postimage
+3,909 −0 1c18e31e0f5fa279862429a79e3520301415588c/preimage
+3,909 −0 1c18e31e0f5fa279862429a79e3520301415588c/thisimage
+3,905 −0 53f0a3be42c0863f44169e9cd145a3533f46e5a6/postimage
+3,913 −0 53f0a3be42c0863f44169e9cd145a3533f46e5a6/preimage
+3,913 −0 53f0a3be42c0863f44169e9cd145a3533f46e5a6/thisimage
+11,981 −0 5d2fce5c26bb65b8679b747c2336a13c50167eb6/postimage
+11,984 −0 5d2fce5c26bb65b8679b747c2336a13c50167eb6/preimage
+24,139 −0 7fae64d4e2252f99d8453a1edfe8a03970762354/postimage
+24,168 −0 7fae64d4e2252f99d8453a1edfe8a03970762354/preimage
+24,034 −0 9339b22d924a801c7011ee856823bd43c2174629/postimage
+24,067 −0 9339b22d924a801c7011ee856823bd43c2174629/preimage
+3,907 −0 a92b6978e3e83060209d6c47d9f5380710efc7f4/postimage
+3,911 −0 a92b6978e3e83060209d6c47d9f5380710efc7f4/preimage
+23,928 −0 ae8481e7d689fea103f1cd8b4b5ed71a90395946/postimage
+23,971 −0 ae8481e7d689fea103f1cd8b4b5ed71a90395946/preimage
+24,137 −0 afbb586f65cb9a0cf14dcec9d1e414e75bb0dc62/postimage
+24,150 −0 afbb586f65cb9a0cf14dcec9d1e414e75bb0dc62/preimage
+3,905 −0 b11db5b8796dd7c8058a69c699e7bad666f48a75/postimage
+3,909 −0 b11db5b8796dd7c8058a69c699e7bad666f48a75/preimage
+2,092 −0 c1bad15701c88ac96365ab0a2805a6d323de5f02/postimage
+2,095 −0 c1bad15701c88ac96365ab0a2805a6d323de5f02/preimage
+23,924 −0 e40025831c9378e58ca126ef9ea460a5b34f6d4a/postimage
+23,967 −0 e40025831c9378e58ca126ef9ea460a5b34f6d4a/preimage
+2,501 −0 ec74e92afb8a1eeaeb0ffe8138e73bc210fbf944/postimage
+2,504 −0 ec74e92afb8a1eeaeb0ffe8138e73bc210fbf944/preimage
+2,090 −0 f9ed29f43546a84b6b30381cbb93c8a559ab94ab/postimage
+2,093 −0 f9ed29f43546a84b6b30381cbb93c8a559ab94ab/preimage
+24,032 −0 fdafb150c6f34e9a555312b9237ee41d343ed000/postimage
+24,078 −0 fdafb150c6f34e9a555312b9237ee41d343ed000/preimage
11 changes: 6 additions & 5 deletions dist/PathTools/lib/File/Spec/Win32.pm
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,12 @@ sub file_name_is_absolute ($self, str $file) {
=item catfile
Concatenate one or more directory names and a filename to form a
complete path ending with a filename
complete path ending with a filename.
@p is either str or File::Temp::Dir.
=cut

sub catfile ($self, str @p) {
sub catfile ($self, @p) {

# Legacy / compatibility support
#
Expand All @@ -142,7 +143,7 @@ sub catfile ($self, str @p) {
return _canon_cat( @p );
}

sub catdir ($self, str @p) {
sub catdir ($self, @p) {

# Legacy / compatibility support
#
Expand Down Expand Up @@ -182,7 +183,7 @@ sub canonpath ($, $path?) {
# Legacy / compatibility support
#
return $path if !defined($path) or $path eq '';
return _canon_cat( $path );
return _canon_cat( "$path" );
}

=item splitpath
Expand Down Expand Up @@ -371,7 +372,7 @@ implementation of these methods, not the semantics.
=cut


sub _canon_cat (str $first, str @rest) # @path -> path
sub _canon_cat ($first, @rest) # @path -> path
{
#print "# ",$first, ", ", @rest, "\n";
my $volume = $first =~ s{ \A ([A-Za-z]:) ([\\/]?) }{}x # drive letter
Expand Down

0 comments on commit f8515f9

Please sign in to comment.