diff --git a/ChangeLog b/ChangeLog index 66966f7..2463c25 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2018-06-22 Jay Berkenbilt + * Don't leave files open when merging. This makes it possible + merge more files at once than the operating system's open file + limit. Fixes #154. + * Add ClosedFileInputSource class, and input source that keeps its input file closed when not reading it. At the expense of some performance, this allows you to operate on many files without diff --git a/qpdf/qpdf.cc b/qpdf/qpdf.cc index 49271c6..783548e 100644 --- a/qpdf/qpdf.cc +++ b/qpdf/qpdf.cc @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -2083,8 +2084,9 @@ static void handle_page_specs(QPDF& pdf, Options& o, QTC::TC("qpdf", "qpdf pages encryption password"); password = o.encryption_file_password; } - qpdf->processFile( - page_spec.filename.c_str(), password); + qpdf->processInputSource( + new ClosedFileInputSource( + page_spec.filename.c_str()), password); page_spec_qpdfs[page_spec.filename] = qpdf; }