aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2003-10-10 14:12:01 +0000
committerMax Horn2003-10-10 14:12:01 +0000
commit251c89b0372200e0f7cd1be1299d9d3cd85160d3 (patch)
treebbc94e687876307db328541760706fa2b5105739
parent413ae8aa3e2ba86ece01cd778c292feb5a5bba75 (diff)
downloadscummvm-rg350-251c89b0372200e0f7cd1be1299d9d3cd85160d3.tar.gz
scummvm-rg350-251c89b0372200e0f7cd1be1299d9d3cd85160d3.tar.bz2
scummvm-rg350-251c89b0372200e0f7cd1be1299d9d3cd85160d3.zip
fix handling of last argument: if it's not a valid target, treat it like any other arg (in particular, this is now legal: ./scummvm -f -g hq3x)
svn-id: r10724
-rw-r--r--base/gameDetector.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/base/gameDetector.cpp b/base/gameDetector.cpp
index d1f340d706..89a2673dea 100644
--- a/base/gameDetector.cpp
+++ b/base/gameDetector.cpp
@@ -482,7 +482,11 @@ void GameDetector::parseCommandLine(int argc, char **argv) {
goto ShowHelpAndExit;
}
} else {
- if (i == (argc - 1)) {
+ // Last argument: this could be a target name.
+ // To verify this, check if there is either a game domain (i.e
+ // a configured target) matching this argument, or if we can
+ // find any target with that name.
+ if (i == (argc - 1) && (ConfMan.hasGameDomain(s) || findTarget(s))) {
setGame(s);
} else {
if (current_option == NULL)