summaryrefslogtreecommitdiffstats
path: root/src/fat_dir.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2011-04-21 19:42:44 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2011-04-21 19:42:44 +0200
commit791794a74fdaa10f1acc707b254161b23007ae26 (patch)
treeb8a5806b41a477c68d3d8519cd9db3d691f44b69 /src/fat_dir.c
parentb555b3a4f62847a5e27173fc48548d5574fe37d1 (diff)
Workaround for Dos/DJGPP, stat.st_size seems to be 31 bits only.
Diffstat (limited to 'src/fat_dir.c')
-rw-r--r--src/fat_dir.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/fat_dir.c b/src/fat_dir.c
index 1691f7c..35fb07d 100644
--- a/src/fat_dir.c
+++ b/src/fat_dir.c
@@ -292,6 +292,9 @@ RecEnd:
new_file->stat.st_gid=0;
new_file->stat.st_rdev=0;
new_file->stat.st_size=le32(de->size);
+#ifdef DJGPP
+ new_file->file_size=le32(de->size);
+#endif
#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
new_file->stat.st_blksize=cluster_size;
#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
@@ -551,7 +554,11 @@ static int fat_copy(disk_t *disk_car, const partition_t *partition, dir_data_t *
const unsigned int block_size=fat_sector_size(fat_header)*sectors_per_cluster;
unsigned char *buffer_file=(unsigned char *)MALLOC(block_size);
unsigned int cluster;
+#ifdef DJGPP
+ unsigned int file_size=file->file_size;
+#else
unsigned int file_size=file->stat.st_size;
+#endif
unsigned int fat_meth=FAT_FOLLOW_CLUSTER;
uint64_t start_fat1,start_data,part_size;
unsigned long int no_of_cluster,fat_length;