msi: Fixed the WriteEnvironmentStrings action

Misha Koshelev mk144210 at
Wed Jun 13 19:23:10 CDT 2007

> +    res = RegQueryValueExW(env, name, NULL, &type, NULL, &size);
> +    if (res != ERROR_FILE_NOT_FOUND || (res == ERROR_SUCCESS && type != REG_SZ))
> +        goto done;
Hate to point this out but isn't this the exact same error I made in my first (and second)
patch from last night? I think it should be:

if ((res != ERROR_FILE_NOT_FOUND && res != ERROR_SUCCESS) ||
    (res == ERROR_SUCCESS && type != REG_SZ))
     goto done;

In your statement, if res is ERROR_SUCCESS it will always goto done no matter what the
value of type, because ERROR_SUCCESS != ERROR_FILE_NOT_FOUND.

Guess logic errors in if statements are contagious :)


More information about the wine-devel mailing list