From a979494897de53ab0ec3260c9741ed3d321bf191 Mon Sep 17 00:00:00 2001 From: Jeff Breidenbach Date: Thu, 19 Jan 2017 15:18:52 +0100 Subject: [PATCH] fix #665 process file list --- api/baseapi.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/api/baseapi.cpp b/api/baseapi.cpp index 6a7d848788..45a8cb65f3 100644 --- a/api/baseapi.cpp +++ b/api/baseapi.cpp @@ -1085,7 +1085,15 @@ bool TessBaseAPI::ProcessPagesInternal(const char* filename, // Maybe we have a filelist if (r != 0 || format == IFF_UNKNOWN) { - STRING s(buf.c_str()); + STRING s; + if (stdInput) { + s = buf.c_str(); + } else { + std::ifstream t(filename); + std::string u((std::istreambuf_iterator(t)), + std::istreambuf_iterator()); + s = u.c_str(); + } return ProcessPagesFileList(NULL, &s, retry_config, timeout_millisec, renderer, tesseract_->tessedit_page_number);