}
-void extract_file(struct file *fi, int lower, int fix, char *dir) {
+int extract_file(struct file *fi, int lower, int fix, char *dir) {
struct folder *fol = fi->folder, *oldfol = CAB(current);
LONG err = DECR_OK;
/* initialisation OK, set current folder and reset offset */
#if 0 /* CAPTIVE */
if (oldfol) cabinet_close(oldfol->cab[CAB(split)]);
- if (!cabinet_open(fol->cab[0])) goto exit_handler;
+ if (!cabinet_open(fol->cab[0])) {
+ err = DECR_ILLEGALDATA;
+ goto exit_handler;
+ }
#endif /* CAPTIVE */
cabinet_seek(fol->cab[0], fol->offset[0]);
CAB(current) = fol;
CAB(offset) = fi->offset;
}
#if 0 /* CAPTIVE */
- if (!file_open(fi, lower, dir)) return;
+ if (!file_open(fi, lower, dir)) return 0;
#endif /* CAPTIVE */
err = decompress(fi, 1, fix);
if (err) CAB(current) = NULL; else CAB(offset) += fi->length;
}
g_warning(errmsg, cabname);
+ return 0;
}
+ return 1;
}
#if 0 /* CAPTIVE */
struct cabinet *find_cabs_in_file(struct acquire_cabinet *acquire_cabinet);
struct file *process_files(struct cabinet *basecab);
-void extract_file(struct file *fi, int lower, int fix, char *dir);
+int extract_file(struct file *fi, int lower, int fix, char *dir);
G_END_DECLS