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
d418ece9
Commit
d418ece9
authored
Jun 22, 2016
by
Hugh McMaster
Committed by
Alexandre Julliard
Jun 23, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Use error handling for missing arguments.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
53c9a789
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
23 deletions
+19
-23
regedit.c
programs/regedit/regedit.c
+19
-23
No files found.
programs/regedit/regedit.c
View file @
d418ece9
...
...
@@ -66,12 +66,6 @@ static BOOL PerformRegAction(REGEDIT_ACTION action, char **argv, int *i)
char
*
filename
=
argv
[
*
i
];
FILE
*
reg_file
;
if
(
!
filename
[
0
])
{
fprintf
(
stderr
,
"regedit: No file name was specified
\n
"
);
fprintf
(
stderr
,
usage
);
exit
(
1
);
}
if
(
filename
[
0
])
{
char
*
realname
=
NULL
;
...
...
@@ -113,30 +107,16 @@ static BOOL PerformRegAction(REGEDIT_ACTION action, char **argv, int *i)
break
;
}
case
ACTION_DELETE
:
{
char
*
reg_key_name
=
argv
[
*
i
]
;
WCHAR
*
reg_key_nameW
=
GetWideString
(
argv
[
*
i
])
;
if
(
!
reg_key_name
[
0
])
{
fprintf
(
stderr
,
"regedit: No registry key was specified for removal
\n
"
);
fprintf
(
stderr
,
usage
);
exit
(
1
);
}
else
{
WCHAR
*
reg_key_nameW
=
GetWideString
(
reg_key_name
);
delete_registry_key
(
reg_key_nameW
);
HeapFree
(
GetProcessHeap
(),
0
,
reg_key_nameW
);
}
delete_registry_key
(
reg_key_nameW
);
HeapFree
(
GetProcessHeap
(),
0
,
reg_key_nameW
);
break
;
}
case
ACTION_EXPORT
:
{
char
*
filename
=
argv
[
*
i
];
WCHAR
*
filenameW
;
if
(
!
filename
[
0
])
{
fprintf
(
stderr
,
"regedit: No filename was specified
\n
"
);
fprintf
(
stderr
,
usage
);
exit
(
1
);
}
filenameW
=
GetWideString
(
filename
);
if
(
filenameW
[
0
])
{
char
*
reg_key_name
=
argv
[
++
(
*
i
)];
...
...
@@ -265,6 +245,22 @@ BOOL ProcessCmdLine(LPSTR lpCmdLine)
}
}
if
(
i
==
argc
)
{
switch
(
action
)
{
case
ACTION_ADD
:
case
ACTION_EXPORT
:
fprintf
(
stderr
,
"regedit: No file name was specified
\n\n
"
);
break
;
case
ACTION_DELETE
:
fprintf
(
stderr
,
"regedit: No registry key was specified for removal
\n\n
"
);
break
;
}
fprintf
(
stderr
,
usage
);
exit
(
1
);
}
PerformRegAction
(
action
,
argv
,
&
i
);
for
(
i
=
0
;
i
<
argc
;
i
++
)
...
...
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