Fixed .rdp and .msrcIncident checks.
The command line detection fails, if only one of the aforementioned
files is used as an argument. Detect those first and ignore command
line detection if found.
@@ -1294,10 +1294,23 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
char* str;
size_t length;
int status;
- DWORD flags;
+ BOOL ext = FALSE;
+ BOOL assist = FALSE;
+ DWORD flags = 0;
BOOL promptForPassword = FALSE;
- BOOL compatibility;
+ BOOL compatibility = FALSE;
COMMAND_LINE_ARGUMENT_A* arg;
+
+ /* Command line detection fails if only a .rdp or .msrcIncident file
+ * is supplied. Check this case first, only then try to detect
+ * legacy command line syntax. */
+ if (argc > 1)
+ {
+ ext = ends_with(argv[1], ".rdp");
+ assist = ends_with(argv[1], ".msrcIncident");
+ }
+
+ if (!ext && !assist)
compatibility = freerdp_client_detect_command_line(argc, argv, &flags,
allowUnknown);
@@ -1309,14 +1322,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
else
{
if (allowUnknown)
- {
flags |= COMMAND_LINE_IGN_UNKNOWN_KEYWORD;
- }
-
- if (argc > 1)
- {
- const BOOL ext = ends_with(argv[1], ".rdp");
- const BOOL assist = ends_with(argv[1], ".msrcIncident");
if (ext)
{
@@ -1327,10 +1333,9 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
if (assist)
{
if (freerdp_client_settings_parse_assistance_file(settings,
- settings->AssistanceFile) < 0)
+ argv[1]) < 0)
return COMMAND_LINE_ERROR_UNEXPECTED_VALUE;
}
- }
CommandLineClearArgumentsA(args);
status = CommandLineParseArgumentsA(argc, (const char**) argv, args, flags,
