msi: make the WriteEnvironmentStrings handling of [~] a bit better

Mikolaj Zalewski mikolajz at google.com
Wed Oct 17 19:11:27 CDT 2007


The default meaning of [~] is a NUL character but in the case of
WriteEnvironmentStrings it should represent the current value of the
variable. get_env_flags tries to handle the case of this token at the
beginning or at the end of the string but is doesn't work as it is
called after deformat_string that already changed it into a NUL. For
strings "[~];Dir" that should append Dir to the variable we clear the
variable as the first char will be a NUL. This patch changes the oder
of these calls what makes it work for Photoshop CS2.

It still won't work if [~] is in the middle of the string, there is an
extra semicolon added, there are some more bugs in
WriteEnvironmentStrings (it tries to delete a value with RegDeleteKey,
the path to user environment variables is invalid) but I've decided
not to make any bigger rewrite of this function unless I will learn to
write some regression tests for it.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0007-msi-make-the-WriteEnvironmentStrings-handling-of-a-bit-better.txt
Url: http://www.winehq.org/pipermail/wine-patches/attachments/20071017/c692b232/attachment-0001.txt 


More information about the wine-patches mailing list