reg: Add basic syntax checks for the export operation.
Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
38954aedf5
commit
d4255506d5
|
@ -18,12 +18,37 @@
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
|
#include <wine/unicode.h>
|
||||||
#include <wine/debug.h>
|
#include <wine/debug.h>
|
||||||
|
|
||||||
|
#include "reg.h"
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(reg);
|
WINE_DEFAULT_DEBUG_CHANNEL(reg);
|
||||||
|
|
||||||
|
static BOOL is_overwrite_switch(const WCHAR *s)
|
||||||
|
{
|
||||||
|
if (strlenW(s) > 2)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if ((s[0] == '/' || s[0] == '-') && (s[1] == 'y' || s[1] == 'Y'))
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
int reg_export(int argc, WCHAR *argv[])
|
int reg_export(int argc, WCHAR *argv[])
|
||||||
{
|
{
|
||||||
|
if (argc == 3 || argc > 5)
|
||||||
|
goto error;
|
||||||
|
|
||||||
|
if (argc == 5 && !is_overwrite_switch(argv[4]))
|
||||||
|
goto error;
|
||||||
|
|
||||||
FIXME(": operation not yet implemented\n");
|
FIXME(": operation not yet implemented\n");
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
error:
|
||||||
|
output_message(STRING_INVALID_SYNTAX);
|
||||||
|
output_message(STRING_FUNC_HELP, struprW(argv[1]));
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue