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