Applied "typo-fix" patch from debian

Fixed bug introduced by boost::filesystem V3 library (missing page-number suffixes on output filenames)
This commit is contained in:
pschaefer 2014-01-09 22:36:54 +00:00
parent 455d121464
commit 6fad7e8bf6
6 changed files with 27 additions and 27 deletions

View File

@ -2,7 +2,7 @@
<project> <project>
<configuration id="0.1769827705" name="Default"> <configuration id="0.1769827705" name="Default">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider"> <extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true"/> <provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/> <provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/> <provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/> <provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>

View File

@ -62,5 +62,8 @@ V3.1.3 me:
compilation with Microsoft Visual C. compilation with Microsoft Visual C.
V3.1.4 me: V3.1.4 me:
fixed stdout output under Windows (crash), no features added or changed. fixed stdout output under Windows (crash), no features added or changed.
V3.1.5 me:
fixed error introduced by new behaviour of boost::filesystem V3
(appending sequential page numbers to output filenames gone missing)
-- --
$Id$ $Id$

View File

@ -1,5 +1,5 @@
--------------- ---------------
SFFTOBMP V3.1.4 SFFTOBMP V3.1.5
--------------- ---------------
Tool to convert "Structured Fax Files" into Windows bitmaps (BMP), Tool to convert "Structured Fax Files" into Windows bitmaps (BMP),
@ -114,7 +114,7 @@ OUTSPEC is interpreted as:
- a filename if only one input file is given. - a filename if only one input file is given.
- a directory name if more than one input file is given. - a directory name if more than one input file is given.
If OUTSPEC is ommitted, the name of the output files will be If OUTSPEC is omitted, the name of the output files will be
derived from the input files and created in the same directory. derived from the input files and created in the same directory.
In case of TIFF output, you can specify the compression by using In case of TIFF output, you can specify the compression by using
@ -193,7 +193,7 @@ TODO
---- ----
- speed up decoder with better table lookups - speed up decoder with better table lookups
(looking at GHz CPUs noadays, i doubt that this happes...) (looking at GHz CPUs nowadays, i doubt that this happens...)
- support other non-intel architectures (64 Bits, different - support other non-intel architectures (64 Bits, different
byte order). Sfftobmp will most likely fail on these. byte order). Sfftobmp will most likely fail on these.
(well, no one complained till now) (well, no one complained till now)
@ -218,11 +218,6 @@ to /dev/null.
I'm always pleased to hear that somebody is actually using my I'm always pleased to hear that somebody is actually using my
software. If you can manage it, e-mail me a quick notice. software. If you can manage it, e-mail me a quick notice.
If you *really* like sfftobmp or depend on it, please look
into my wishlist:
http://www.amazon.de/gp/registry/wishlist/OVQ6LSYS4E4D/028-1843567-9543743
Thanks! Thanks!
Contact: Contact:

View File

@ -109,7 +109,7 @@ void CCmdLineProcessor::printHelp()
cout << "The OUTSPEC is interpreted as:" << endl; cout << "The OUTSPEC is interpreted as:" << endl;
cout << " - a filename if only one input file is given." << endl; cout << " - a filename if only one input file is given." << endl;
cout << " - a directory name if more than one input file is given." << endl << endl; cout << " - a directory name if more than one input file is given." << endl << endl;
cout << "If OUTSPEC is ommitted, the name of the output files will be derived from the input" << endl; cout << "If OUTSPEC is omitted, the name of the output files will be derived from the input" << endl;
cout << "files and created in the same directory." << endl << endl; cout << "files and created in the same directory." << endl << endl;
cout << "Output on stdout is available for multipaged TIFF output only (option \"-t\")." << endl; cout << "Output on stdout is available for multipaged TIFF output only (option \"-t\")." << endl;
cout << "Use \"-\" as output filename in this case." << endl << endl; cout << "Use \"-\" as output filename in this case." << endl << endl;

View File

@ -38,6 +38,8 @@
#include <cassert> #include <cassert>
#include <vector> #include <vector>
#include <iostream> #include <iostream>
#include <sstream>
#include <iomanip>
#include <boost/filesystem/path.hpp> #include <boost/filesystem/path.hpp>
#include <boost/filesystem/operations.hpp> #include <boost/filesystem/operations.hpp>
@ -71,6 +73,7 @@ int main( int argc, char *argv[] )
fs::path pathInFileName; fs::path pathInFileName;
fs::path pathOutFileName; fs::path pathOutFileName;
fs::path pathOutDirectory; fs::path pathOutDirectory;
stringstream ssFilename;
CCmdLineProcessor proc(argv, argc); CCmdLineProcessor proc(argv, argc);
@ -116,7 +119,6 @@ int main( int argc, char *argv[] )
{ {
COutputFilter *pOut = NULL; COutputFilter *pOut = NULL;
CSffFile *pInfile = NULL; CSffFile *pInfile = NULL;
char acNumber[10];
try try
{ {
@ -172,32 +174,32 @@ int main( int argc, char *argv[] )
if (pathOutFileName.string().length()) { if (pathOutFileName.string().length()) {
// A fixed name was given, so use it as a base name // A fixed name was given, so use it as a base name
outPath = pathOutFileName; outPath = pathOutFileName;
std::string orgExt = fs::extension(outPath); std::string orgExt = outPath.extension().generic_string();
if (nFileCountOut > 1) { if (nFileCountOut > 1) {
sprintf(acNumber, "_%03d", nPage+1); outPath.replace_extension("");
outPath = fs::change_extension(outPath, acNumber); ssFilename << outPath.generic_string();
if (orgExt.length()) { ssFilename << "_" << setw(3) << setfill('0') << nPage+1;
std::string strTemp = outPath.string(); ssFilename << orgExt;
strTemp += orgExt; outPath = fs::path(ssFilename.str());
outPath = fs::path(strTemp);
}
} }
} else { } else {
// Otherwise construct output filename from input filename // Otherwise construct output filename from input filename
outPath = pathOutDirectory / pathInFileName.leaf(); outPath = pathOutDirectory / pathInFileName.filename();
if (nFileCountOut > 1) { if (nFileCountOut > 1) {
sprintf(acNumber, "_%03d", nPage+1); outPath.replace_extension("");
outPath = fs::change_extension(outPath, acNumber); ssFilename << outPath.generic_string();
std::string strTemp = outPath.string(); ssFilename << "_" << setw(3) << setfill('0') << nPage+1;
strTemp += pOut->GetExtension(); ssFilename << pOut->GetExtension();
outPath = fs::path(strTemp); outPath = fs::path(ssFilename.str());
} else { } else {
outPath = fs::change_extension(outPath, pOut->GetExtension()); outPath.replace_extension(pOut->GetExtension());
} }
} }
if (!proc.doOverwrite() && !((nPage > 0) && (nFileCountOut == 1)) && fs::exists(outPath)) { if (!proc.doOverwrite() && !((nPage > 0) && (nFileCountOut == 1)) && fs::exists(outPath)) {
throw CSimpleException(CSimpleException::err_outfileexists); throw CSimpleException(CSimpleException::err_outfileexists);
} }
ssFilename.str("");
ssFilename.clear();
} }
bool bIsLowRes = pInfile->IsLowRes(nPage); bool bIsLowRes = pInfile->IsLowRes(nPage);

View File

@ -238,7 +238,7 @@ namespace boost
// versions of iterator_adaptor The idea is that when the user needs // versions of iterator_adaptor The idea is that when the user needs
// to fiddle with the reference type it is highly likely that the // to fiddle with the reference type it is highly likely that the
// iterator category has to be adjusted as well. Any of the // iterator category has to be adjusted as well. Any of the
// following four template arguments may be ommitted or explicitly // following four template arguments may be omitted or explicitly
// replaced by use_default. // replaced by use_default.
// //
// Value - if supplied, the value_type of the resulting iterator, unless // Value - if supplied, the value_type of the resulting iterator, unless