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
a0a12d9f
Commit
a0a12d9f
authored
Dec 05, 2017
by
Hugh McMaster
Committed by
Alexandre Julliard
Dec 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reg: Allow switches to be uppercase or lowercase.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
18182676
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
7 deletions
+15
-7
reg.c
programs/reg/reg.c
+10
-2
reg.c
programs/reg/tests/reg.c
+5
-5
No files found.
programs/reg/reg.c
View file @
a0a12d9f
...
...
@@ -890,12 +890,20 @@ BOOL parse_registry_key(const WCHAR *key, HKEY *root, WCHAR **path, WCHAR **long
return
TRUE
;
}
static
BOOL
is_
help_switch
(
const
WCHAR
*
s
)
static
BOOL
is_
switch
(
const
WCHAR
*
s
,
const
WCHAR
c
)
{
if
(
strlenW
(
s
)
>
2
)
return
FALSE
;
if
((
s
[
0
]
==
'/'
||
s
[
0
]
==
'-'
)
&&
(
s
[
1
]
==
'h'
||
s
[
1
]
==
'?'
))
if
((
s
[
0
]
==
'/'
||
s
[
0
]
==
'-'
)
&&
(
s
[
1
]
==
c
||
s
[
1
]
==
toupperW
(
c
)))
return
TRUE
;
return
FALSE
;
}
static
BOOL
is_help_switch
(
const
WCHAR
*
s
)
{
if
(
is_switch
(
s
,
'?'
)
||
is_switch
(
s
,
'h'
))
return
TRUE
;
return
FALSE
;
...
...
programs/reg/tests/reg.c
View file @
a0a12d9f
...
...
@@ -231,7 +231,7 @@ static void test_add(void)
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
run_reg_exe
(
"reg add -H"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
err
=
RegDeleteKeyA
(
HKEY_CURRENT_USER
,
KEY_BASE
);
ok
(
err
==
ERROR_SUCCESS
||
err
==
ERROR_FILE_NOT_FOUND
,
"got %d
\n
"
,
err
);
...
...
@@ -618,7 +618,7 @@ static void test_delete(void)
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
run_reg_exe
(
"reg delete -H"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
add_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
&
hkey
);
add_value
(
hkey
,
"foo"
,
REG_DWORD
,
&
deadbeef
,
sizeof
(
deadbeef
));
...
...
@@ -676,7 +676,7 @@ static void test_query(void)
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
run_reg_exe
(
"reg query -H"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
/* Create a test key */
add_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
&
key
);
...
...
@@ -870,7 +870,7 @@ static void test_import(void)
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
run_reg_exe
(
"reg import -H"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
run_reg_exe
(
"reg import missing.reg"
,
&
r
);
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
...
...
@@ -4419,7 +4419,7 @@ static void test_export(void)
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
run_reg_exe
(
"reg export -H"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
run_reg_exe
(
"reg export
\\\\
remote-pc
\\
HKLM
\\
Wine file.reg"
,
&
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