reg: Move 'import' syntax checks to reg_import().
Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
8801118e38
commit
4cbf47054f
|
@ -983,13 +983,22 @@ cleanup:
|
|||
return NULL;
|
||||
}
|
||||
|
||||
int reg_import(const WCHAR *filename)
|
||||
int reg_import(int argc, WCHAR *argvW[])
|
||||
{
|
||||
WCHAR *filename, *pos;
|
||||
FILE *fp;
|
||||
static const WCHAR rb_mode[] = {'r','b',0};
|
||||
BYTE s[2];
|
||||
struct parser parser;
|
||||
WCHAR *pos;
|
||||
|
||||
if (argc > 3)
|
||||
{
|
||||
output_message(STRING_INVALID_SYNTAX);
|
||||
output_message(STRING_FUNC_HELP, wcsupr(argvW[1]));
|
||||
return 1;
|
||||
}
|
||||
|
||||
filename = argvW[2];
|
||||
|
||||
fp = _wfopen(filename, rb_mode);
|
||||
if (!fp)
|
||||
|
|
|
@ -389,15 +389,8 @@ int __cdecl wmain(int argc, WCHAR *argvW[])
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (op == REG_IMPORT && argc > 3)
|
||||
{
|
||||
output_message(STRING_INVALID_SYNTAX);
|
||||
output_message(STRING_FUNC_HELP, wcsupr(argvW[1]));
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (op == REG_IMPORT)
|
||||
return reg_import(argvW[2]);
|
||||
return reg_import(argc, argvW);
|
||||
|
||||
if (op == REG_EXPORT)
|
||||
return reg_export(argc, argvW);
|
||||
|
|
|
@ -56,7 +56,7 @@ int reg_delete(HKEY root, WCHAR *path, WCHAR *key_name, WCHAR *value_name,
|
|||
int reg_export(int argc, WCHAR *argv[]);
|
||||
|
||||
/* import.c */
|
||||
int reg_import(const WCHAR *filename);
|
||||
int reg_import(int argc, WCHAR *argvW[]);
|
||||
|
||||
/* query.c */
|
||||
int reg_query(HKEY root, WCHAR *path, WCHAR *key_name, WCHAR *value_name,
|
||||
|
|
Loading…
Reference in New Issue