[Scummvm-cvs-logs] SF.net SVN: scummvm: [26941] scummvm/trunk/base/commandLine.cpp

sev at users.sourceforge.net sev at users.sourceforge.net
Sat May 26 17:59:55 CEST 2007


Revision: 26941
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26941&view=rev
Author:   sev
Date:     2007-05-26 08:59:54 -0700 (Sat, 26 May 2007)

Log Message:
-----------
Fix wrong error message as pointed out by jvprat. I.e. ./scummvm -g produced:
"Option '(null)' requires an argument"

Modified Paths:
--------------
    scummvm/trunk/base/commandLine.cpp

Modified: scummvm/trunk/base/commandLine.cpp
===================================================================
--- scummvm/trunk/base/commandLine.cpp	2007-05-26 15:28:31 UTC (rev 26940)
+++ scummvm/trunk/base/commandLine.cpp	2007-05-26 15:59:54 UTC (rev 26941)
@@ -251,12 +251,12 @@
 // Use this for options which have a required (string) value
 #define DO_OPTION(shortCmd, longCmd) \
 	DO_OPTION_OPT(shortCmd, longCmd, 0) \
-	if (!option) usage("Option '%s' requires an argument", argv[i]);
+	if (!option) usage("Option '%s' requires an argument", argv[i-1]);
 
 // Use this for options which have a required integer value
 #define DO_OPTION_INT(shortCmd, longCmd) \
 	DO_OPTION_OPT(shortCmd, longCmd, 0) \
-	if (!option) usage("Option '%s' requires an argument", argv[i]); \
+	if (!option) usage("Option '%s' requires an argument", argv[i-1]); \
 	char *endptr = 0; \
 	int intValue; intValue = (int)strtol(option, &endptr, 0); \
 	if (endptr == NULL || *endptr != 0) usage("--%s: Invalid number '%s'", longCmd, option);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list