mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Handle absolute attachment pathnames
We must use only the basename part of the embedded attachment filename, because the directories used in the path on the machine where the attachments were created may not even exist on the machine where they are extracted.
This commit is contained in:
committed by
Qingping Hou
parent
ff23916940
commit
d90b01dbfd
2
extr.c
2
extr.c
@@ -50,7 +50,7 @@ int save_attachments(int pageno, char *targetdir)
|
||||
pdf_obj *fs_obj = pdf_dict_gets(annot->obj, "FS");
|
||||
if (fs_obj) {
|
||||
pdf_obj *ef_obj;
|
||||
char *name = pdf_to_str_buf(pdf_dict_gets(fs_obj, "F"));
|
||||
char *name = basename(strdup(pdf_to_str_buf(pdf_dict_gets(fs_obj, "F"))));
|
||||
ef_obj = pdf_dict_gets(fs_obj, "EF");
|
||||
if (ef_obj) {
|
||||
pdf_obj *f_obj = pdf_dict_gets(ef_obj, "F");
|
||||
|
||||
Reference in New Issue
Block a user