1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 04:50:09 +00:00

fix file copy for empty input

This commit is contained in:
Lu Wang 2013-01-28 21:56:22 +08:00
parent f3b6c2c889
commit 272fb57755

View File

@ -414,6 +414,7 @@ void HTMLRenderer::post_process()
if(!fin)
throw "Cannot open read the pages";
output << fin.rdbuf();
output.clear(); // output will set fail big if fin is empty
}
else if (line == "$pages")
{
@ -421,6 +422,7 @@ void HTMLRenderer::post_process()
if(!fin)
throw "Cannot open read the pages";
output << fin.rdbuf();
output.clear(); // output will set fail big if fin is empty
}
else
{
@ -458,8 +460,9 @@ void HTMLRenderer::embed_file(ostream & out, const string & path, const string &
if(!fin)
throw string("Cannot open file ") + path + " for embedding";
out << iter->second.first << endl
<< fin.rdbuf()
<< iter->second.second << endl;
<< fin.rdbuf();
out.clear(); // out will set fail big if fin is empty
out << iter->second.second << endl;
}
else
{
@ -477,6 +480,7 @@ void HTMLRenderer::embed_file(ostream & out, const string & path, const string &
if(!out)
throw string("Cannot open file ") + path + " for embedding";
out << fin.rdbuf();
out.clear(); // out will set fail big if fin is empty
}
}
}