Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
08976b3e
Commit
08976b3e
authored
Mar 30, 2021
by
Hugh McMaster
Committed by
Alexandre Julliard
Mar 30, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reg: Fail if duplicate command-line switches are passed to 'reg add'.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9138f589
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
add.c
programs/reg/add.c
+3
-1
add.c
programs/reg/tests/add.c
+2
-2
No files found.
programs/reg/add.c
View file @
08976b3e
...
...
@@ -227,6 +227,7 @@ int reg_add(int argc, WCHAR *argvW[])
if
(
!
lstrcmpiW
(
str
,
L"ve"
))
{
if
(
value_empty
)
goto
invalid
;
value_empty
=
TRUE
;
continue
;
}
...
...
@@ -249,11 +250,12 @@ int reg_add(int argc, WCHAR *argvW[])
break
;
case
's'
:
str
=
argvW
[
++
i
];
if
(
!
str
||
lstrlenW
(
str
)
!=
1
)
if
(
separator
||
!
str
||
lstrlenW
(
str
)
!=
1
)
goto
invalid
;
separator
=
str
[
0
];
break
;
case
'f'
:
if
(
force
)
goto
invalid
;
force
=
TRUE
;
break
;
default:
...
...
programs/reg/tests/add.c
View file @
08976b3e
...
...
@@ -234,7 +234,7 @@ static void test_add(void)
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /f /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
);
open_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
,
&
hkey
);
...
...
@@ -295,7 +295,7 @@ static void test_add(void)
verify_reg
(
hkey
,
NULL
,
REG_SZ
,
""
,
1
,
0
);
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /ve /f /ve"
,
&
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 add HKEY_CURRENT_USER
\\
"
KEY_BASE
" /ve /d WineTEST /f"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\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