reg: Fixed 2 functionality bugs in REG DELETE (Coverity).

This commit is contained in:
Marcus Meissner 2009-12-06 22:45:48 +01:00 committed by Alexandre Julliard
parent 13608c8b18
commit 552db89b06
1 changed files with 4 additions and 3 deletions

View File

@ -255,7 +255,8 @@ static int reg_delete(WCHAR *key_name, WCHAR *value_name, BOOL value_empty,
/* FIXME: Prompt for delete */
}
if (!value_name)
/* Delete subtree only if no /v* option is given */
if (!value_name && !value_empty && !value_all)
{
if (RegDeleteTreeW(root,p)!=ERROR_SUCCESS)
{
@ -293,10 +294,10 @@ static int reg_delete(WCHAR *key_name, WCHAR *value_name, BOOL value_empty,
while (1)
{
count = maxValue;
rc = RegEnumValueW(subkey, 0, value_name, &count, NULL, NULL, NULL, NULL);
rc = RegEnumValueW(subkey, 0, szValue, &count, NULL, NULL, NULL, NULL);
if (rc == ERROR_SUCCESS)
{
rc = RegDeleteValueW(subkey,value_name);
rc = RegDeleteValueW(subkey, szValue);
if (rc != ERROR_SUCCESS)
break;
}