summaryrefslogtreecommitdiffstats
path: root/src/fat_adv.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_adv.c
parentb555b3a4f62847a5e27173fc48548d5574fe37d1 (diff)
Workaround for Dos/DJGPP, stat.st_size seems to be 31 bits only.
Diffstat (limited to 'src/fat_adv.c')
-rw-r--r--src/fat_adv.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/fat_adv.c b/src/fat_adv.c
index 2e4c3dd..69c6ebf 100644
--- a/src/fat_adv.c
+++ b/src/fat_adv.c
@@ -228,7 +228,11 @@ static int ask_root_directory(disk_t *disk_car, const partition_t *partition, co
mode_string(current_file->stat.st_mode,str);
wprintw(window, "%s %3u %3u ",
str, (unsigned int)current_file->stat.st_uid, (unsigned int)current_file->stat.st_gid);
+#ifdef DJGPP
+ wprintw(window, "%9llu", (long long unsigned int)current_file->file_size);
+#else
wprintw(window, "%9llu", (long long unsigned int)current_file->stat.st_size);
+#endif
/* FIXME: screen overlaps due to long filename */
wprintw(window, " %s %s\n", datestr, current_file->name);
if(current_file==pos)
@@ -625,7 +629,11 @@ static int file2entry(struct msdos_dir_entry *de, const file_data_t *current_fil
fat_date_unix2dos(current_file->stat.st_mtime,&de->time,&de->date);
de->start=le16(current_file->stat.st_ino);
de->starthi=le16(current_file->stat.st_ino>>16);
+#ifdef DJGPP
+ de->size=le32(current_file->file_size);
+#else
de->size=le32(current_file->stat.st_size);
+#endif
return 0;
}