Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
8801118e
Commit
8801118e
authored
Mar 18, 2021
by
Hugh McMaster
Committed by
Alexandre Julliard
Mar 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reg: Simplify basic syntax checks.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7803c53c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
reg.c
programs/reg/reg.c
+10
-7
No files found.
programs/reg/reg.c
View file @
8801118e
...
@@ -349,7 +349,6 @@ static enum operations get_operation(const WCHAR *str, int *op_help)
...
@@ -349,7 +349,6 @@ static enum operations get_operation(const WCHAR *str, int *op_help)
int
__cdecl
wmain
(
int
argc
,
WCHAR
*
argvW
[])
int
__cdecl
wmain
(
int
argc
,
WCHAR
*
argvW
[])
{
{
int
i
,
op
,
op_help
,
ret
;
int
i
,
op
,
op_help
,
ret
;
BOOL
show_op_help
=
FALSE
;
static
const
WCHAR
switchVAW
[]
=
{
'v'
,
'a'
,
0
};
static
const
WCHAR
switchVAW
[]
=
{
'v'
,
'a'
,
0
};
static
const
WCHAR
switchVEW
[]
=
{
'v'
,
'e'
,
0
};
static
const
WCHAR
switchVEW
[]
=
{
'v'
,
'e'
,
0
};
WCHAR
*
key_name
,
*
path
,
*
value_name
=
NULL
,
*
type
=
NULL
,
*
data
=
NULL
,
separator
=
'\0'
;
WCHAR
*
key_name
,
*
path
,
*
value_name
=
NULL
,
*
type
=
NULL
,
*
data
=
NULL
,
separator
=
'\0'
;
...
@@ -377,22 +376,26 @@ int __cdecl wmain(int argc, WCHAR *argvW[])
...
@@ -377,22 +376,26 @@ int __cdecl wmain(int argc, WCHAR *argvW[])
output_message
(
STRING_REG_HELP
);
output_message
(
STRING_REG_HELP
);
return
1
;
return
1
;
}
}
else
if
(
argc
==
2
)
/* Valid operation, no arguments supplied */
if
(
argc
>
2
)
show_op_help
=
is_help_switch
(
argvW
[
2
]);
if
(
argc
==
2
||
((
show_op_help
||
op
==
REG_IMPORT
)
&&
argc
>
3
))
{
{
output_message
(
STRING_INVALID_SYNTAX
);
output_message
(
STRING_INVALID_SYNTAX
);
output_message
(
STRING_FUNC_HELP
,
wcsupr
(
argvW
[
1
]));
output_message
(
STRING_FUNC_HELP
,
wcsupr
(
argvW
[
1
]));
return
1
;
return
1
;
}
}
else
if
(
show_op_help
)
if
(
is_help_switch
(
argvW
[
2
]))
{
{
output_message
(
op_help
);
output_message
(
op_help
);
return
0
;
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
)
if
(
op
==
REG_IMPORT
)
return
reg_import
(
argvW
[
2
]);
return
reg_import
(
argvW
[
2
]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment