summaryrefslogtreecommitdiffstats
path: root/perl-install/resize_fat/any.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-10-10 13:03:27 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-10-10 13:03:27 +0000
commiteaf1f7e94354b3bf37db6864de8364ffbda223f7 (patch)
tree05731f231be1d45508a726543a7f01226dacd0b1 /perl-install/resize_fat/any.pm
parent5e3f79e9a036b95eb9508746a5e47acda54586b0 (diff)
downloaddrakx-backup-do-not-use-eaf1f7e94354b3bf37db6864de8364ffbda223f7.tar
drakx-backup-do-not-use-eaf1f7e94354b3bf37db6864de8364ffbda223f7.tar.gz
drakx-backup-do-not-use-eaf1f7e94354b3bf37db6864de8364ffbda223f7.tar.bz2
drakx-backup-do-not-use-eaf1f7e94354b3bf37db6864de8364ffbda223f7.tar.xz
drakx-backup-do-not-use-eaf1f7e94354b3bf37db6864de8364ffbda223f7.zip
no_comment
Diffstat (limited to 'perl-install/resize_fat/any.pm')
-rw-r--r--perl-install/resize_fat/any.pm16
1 files changed, 7 insertions, 9 deletions
diff --git a/perl-install/resize_fat/any.pm b/perl-install/resize_fat/any.pm
index 6acd0b52c..7d7d006fa 100644
--- a/perl-install/resize_fat/any.pm
+++ b/perl-install/resize_fat/any.pm
@@ -57,7 +57,8 @@ sub max_size($) {
#- Each FAT entry is flagged as either FREE, FILE or DIRECTORY.
sub flag_clusters {
my ($fs) = @_;
- my ($cluster, $entry, $type);
+ my ($cluster, $entry, $type, $nb_dirs);
+ my $fat_flag_map = "\0" x ($fs->{nb_clusters} + 2);
my $f = sub {
($entry) = @_;
@@ -69,14 +70,11 @@ sub flag_clusters {
$type = $DIRECTORY;
} else { return }
- for (; !resize_fat::fat::is_eof($cluster); $cluster = resize_fat::fat::next($fs, $cluster)) {
- $cluster == 0 and die "Bad FAT: unterminated chain for $entry->{name}\n";
- $fs->{fat_flag_map}[$cluster] and die "Bad FAT: cluster $cluster is cross-linked for $entry->{name}\n";
- $fs->{fat_flag_map}[$cluster] = $type;
- $fs->{clusters}{count}{dirs}++ if $type == $DIRECTORY;
- }
+ my $nb = resize_fat::c_rewritten::checkFat($fat_flag_map, $cluster, $type, $entry->{name});
+ $nb_dirs += $nb if $type == $DIRECTORY;
+ 0;
};
- $fs->{fat_flag_map} = [ ($FREE) x ($fs->{nb_clusters} + 2) ];
- $fs->{clusters}{count}{dirs} = 0;
resize_fat::directory::traverse_all($fs, $f);
+ $fs->{fat_flag_map} = $fat_flag_map;
+ $fs->{clusters}{count}{dirs} = $nb_dirs;
}