fu-common-cab: Correct handling of CAB files w/ nested directories and older libgcab

CABs like this are commonly created by `makecab.exe` on Windows.
```
DriverPackage\filename.bin
DriverPackage\filename.metainfo.xml
```

On gcab < 1.0 the comparison needs to be made without this directory name.
This commit is contained in:
Mario Limonciello 2019-02-07 14:09:16 -06:00 committed by Richard Hughes
parent 237e842e7c
commit 30ad58c9cd

View File

@ -33,7 +33,7 @@ _gcab_cabinet_get_file_by_name (GCabCabinet *cabinet, const gchar *basename)
g_autoptr(GSList) files = gcab_folder_get_files (cabfolder);
for (GSList *l = files; l != NULL; l = l->next) {
GCabFile *cabfile = GCAB_FILE (l->data);
if (g_strcmp0 (gcab_file_get_name (cabfile), basename) == 0)
if (g_strcmp0 (gcab_file_get_extract_name (cabfile), basename) == 0)
return cabfile;
}
#endif