diff options
Diffstat (limited to 'unrar/unrar.c')
| -rw-r--r-- | unrar/unrar.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/unrar/unrar.c b/unrar/unrar.c index f24aca5..f804ff2 100644 --- a/unrar/unrar.c +++ b/unrar/unrar.c @@ -326,6 +326,7 @@ VFSOpenArchive (struct TVFSGlobs *globs, const char *sName) TVFSResult Result; HANDLE PASCAL handle; struct RAROpenArchiveDataEx *archive_data; + guint64 inode_no; Result = cVFS_OK; @@ -336,6 +337,7 @@ VFSOpenArchive (struct TVFSGlobs *globs, const char *sName) globs->total_size = 0; globs->failed_passwd_callback = FALSE; globs->volume_missing_abort = FALSE; + inode_no = 0; fprintf (stderr, "(--) VFSOpenArchive: trying to open archive '%s'...\n", globs->archive_path); /* WARNING: do not use g_malloc0() here, leads to memory corruption */ @@ -372,11 +374,14 @@ VFSOpenArchive (struct TVFSGlobs *globs, const char *sName) while ((res = RARReadHeaderEx(handle, header)) == 0) { // printf(" header->FileName = '%s', Flags = 0x%x\n", header->FileName, header->Flags); + inode_no++; + /* Create a TVFSItem entry and fill all info */ struct TVFSItem *item = g_malloc0 (sizeof (struct TVFSItem)); item->iSize = (guint64)((guint64)(header->UnpSizeHigh * 0x100000000) + (guint64)header->UnpSize); item->iPackedSize = (guint64)((guint64)(header->PackSizeHigh * 0x100000000) + (guint64)header->PackSize); + item->inode_no = inode_no; globs->total_size += item->iSize; if ((header->Flags & 0x00e0 /* LHD_WINDOWMASK */ ) == 0x00e0 /* LHD_DIRECTORY */) item->ItemType = vDirectory; @@ -416,7 +421,7 @@ VFSOpenArchive (struct TVFSGlobs *globs, const char *sName) // g_print (" ansi = '%s'\n wide = '%ls'\n utf8 = '%s'\n", header->FileName, header->FileNameW, s); // Add item to the global list and continue with next file - filelist_tree_add_item (globs->files, s, item, header->FileName, 0); + filelist_tree_add_item (globs->files, s, item, header->FileName, inode_no); g_free (s); int PASCAL res2 = RARProcessFile (handle, RAR_SKIP, NULL, NULL); |
