[Scummvm-cvs-logs] scummvm-tools master -> 6f89394c6b6cc757d56823e4a468f576b37eb26a
criezy
criezy at scummvm.org
Mon Oct 20 21:18:08 CEST 2014
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm-tools' repo located at https://github.com/scummvm/scummvm-tools .
Summary:
6f89394c6b TOOLS: Make input files handling more robust
Commit: 6f89394c6b6cc757d56823e4a468f576b37eb26a
https://github.com/scummvm/scummvm-tools/commit/6f89394c6b6cc757d56823e4a468f576b37eb26a
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2014-10-20T20:17:57+01:00
Commit Message:
TOOLS: Make input files handling more robust
Some tools have a very generic input file format (e.g. *.*) but
reimplement inspectInput() to restrict the acceptable inputs.
However this was only used when working out which tool can
process a given input (when the tool is not specified). Now this
is also used when checking the inputs given to a specific tool.
Changed paths:
tool.cpp
diff --git a/tool.cpp b/tool.cpp
index 15f09e8..e34fc2c 100644
--- a/tool.cpp
+++ b/tool.cpp
@@ -142,6 +142,12 @@ void Tool::clearInputPaths() {
}
bool Tool::addInputPath(const std::string& in) {
+ // Check the input is acceptable. Usually this is done when calling inspectInput(filename, format),
+ // but inspectInput(filename) might be reimplemented to be more restrictive (especially when the
+ // format is "*.*").
+ if (inspectInput(in) == IMATCH_AWFUL)
+ return false;
+ // Now we know it matches. Look for the best match.
int bestMatchIndex = -1;
InspectionMatch bestMatch = IMATCH_AWFUL;
for (ToolInputs::iterator iter = _inputPaths.begin(); iter != _inputPaths.end(); ++iter) {
More information about the Scummvm-git-logs
mailing list