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.
pull/2/merge
Tigran Aivazian 12 years ago committed by Qingping Hou
parent ff23916940
commit d90b01dbfd

@ -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");

Loading…
Cancel
Save