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
6c466296
Commit
6c466296
authored
May 17, 2021
by
Hugh McMaster
Committed by
Alexandre Julliard
May 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reg: Fail if one or more arguments follow a help switch.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ac32dd8a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
+12
-9
reg.c
programs/reg/reg.c
+8
-5
copy.c
programs/reg/tests/copy.c
+4
-4
No files found.
programs/reg/reg.c
View file @
6c466296
...
...
@@ -349,14 +349,12 @@ int __cdecl wmain(int argc, WCHAR *argvW[])
return
1
;
}
else
if
(
argc
==
2
)
/* Valid operation, no arguments supplied */
{
output_message
(
STRING_INVALID_SYNTAX
);
output_message
(
STRING_FUNC_HELP
,
wcsupr
(
argvW
[
1
]));
return
1
;
}
goto
invalid
;
if
(
is_help_switch
(
argvW
[
2
]))
{
if
(
argc
>
3
)
goto
invalid
;
output_message
(
op_help
);
output_message
(
STRING_REG_VIEW_USAGE
);
return
0
;
...
...
@@ -378,4 +376,9 @@ int __cdecl wmain(int argc, WCHAR *argvW[])
return
reg_import
(
argc
,
argvW
);
return
reg_query
(
argc
,
argvW
);
invalid:
output_message
(
STRING_INVALID_SYNTAX
);
output_message
(
STRING_FUNC_HELP
,
wcsupr
(
argvW
[
1
]));
return
1
;
}
programs/reg/tests/copy.c
View file @
6c466296
...
...
@@ -37,16 +37,16 @@ static void test_command_syntax(void)
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
run_reg_exe
(
"reg copy /? /f"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg copy /h /f"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg copy /? /s"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg copy /h /s"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
run_reg_exe
(
"reg copy /f"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
...
...
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