Commit 4cbf4705 authored by Hugh McMaster's avatar Hugh McMaster Committed by Alexandre Julliard

reg: Move 'import' syntax checks to reg_import().

parent 8801118e
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment