Skip to content

Commit 869609d

Browse files
committed
Coercing command line argument values to uppercase
Certain command line arguments require values that are uppercase, notably, the -log-level and -implementation command line switches. If the values of these arguments are not uppercase, IEDriverServer.exe will fall back to the default value for the switch. Since Windows command lines are in the main case-insensitive, it makes sense to coerce these values to uppercase.
1 parent ba2c218 commit 869609d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cpp/iedriverserver/IEDriverServer.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,18 @@ int _tmain(int argc, _TCHAR* argv[]) {
240240
std::wstring executable_version = GetExecutableVersion();
241241
std::wstring implementation = args.GetValue(IMPLEMENTATION_COMMAND_LINE_ARG,
242242
L"");
243+
244+
// coerce log level and implementation to uppercase, making the values
245+
// case-insensitive, to match expected values.
246+
std::transform(log_level.begin(),
247+
log_level.end(),
248+
log_level.begin(),
249+
toupper);
250+
std::transform(implementation.begin(),
251+
implementation.end(),
252+
implementation.begin(),
253+
toupper);
254+
243255
void* server_value = start_server_ex_proc(port,
244256
host_address,
245257
log_level,

0 commit comments

Comments
 (0)