File Coverage

blib/lib/URI/file/FAT.pm
Criterion Covered Total %
statement 19 19 100.0
branch 6 8 75.0
condition n/a
subroutine 4 4 100.0
pod 0 1 0.0
total 29 32 90.6


line stmt bran cond sub pod time code
1             package URI::file::FAT;
2              
3 1     1   9 use strict;
  1         3  
  1         67  
4 1     1   12 use warnings;
  1         5  
  1         66  
5              
6 1     1   16 use parent 'URI::file::Win32';
  1         3  
  1         27  
7              
8             our $VERSION = '5.21';
9              
10             sub fix_path
11             {
12 2     2 0 3 shift; # class
13 2         5 for (@_) {
14             # turn it into 8.3 names
15 6         21 my @p = map uc, split(/\./, $_, -1);
16 6 50       20 return if @p > 2; # more than 1 dot is not allowed
17 6 100       16 @p = ("") unless @p; # split bug? (returns nothing when splitting "")
18 6         12 $_ = substr($p[0], 0, 8);
19 6 100       15 if (@p > 1) {
20 1         3 my $ext = substr($p[1], 0, 3);
21 1 50       6 $_ .= ".$ext" if length $ext;
22             }
23             }
24 2         8 1; # ok
25             }
26              
27             1;