regedit: Having garbage after the dash in '"foo"=-' is not valid.

Don't complain if the value already does not exist.
This commit is contained in:
Francois Gouget 2007-06-14 11:47:50 +02:00 committed by Alexandre Julliard
parent bde3cf9b5f
commit 0dac54b3a7
1 changed files with 5 additions and 2 deletions

View File

@ -219,8 +219,11 @@ static LONG setValue(LPSTR val_name, LPSTR val_data)
if ( (val_name == NULL) || (val_data == NULL) )
return ERROR_INVALID_PARAMETER;
if (val_data[0] == '-')
return RegDeleteValue(currentKeyHandle,val_name);
if (strcmp(val_data, "-") == 0)
{
res=RegDeleteValue(currentKeyHandle,val_name);
return (res == ERROR_FILE_NOT_FOUND ? ERROR_SUCCESS : res);
}
/* Get the data type stored into the value field */
dwDataType = getDataType(&val_data, &dwParseType);