Hans Leidekker : msi: Don' t parse the format string when building the shortcut target path.

Alexandre Julliard julliard at winehq.org
Thu Jan 19 14:56:54 CST 2012


Module: wine
Branch: master
Commit: d20c69c54dbc52030162042d78e9fc60c9a93d7b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d20c69c54dbc52030162042d78e9fc60c9a93d7b

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Thu Jan 19 12:27:05 2012 +0100

msi: Don't parse the format string when building the shortcut target path.

It's no longer necessary because target paths are always normalized.

---

 dlls/msi/action.c |   18 +-----------------
 1 files changed, 1 insertions(+), 17 deletions(-)

diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index baebdc2..2347902 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -3601,25 +3601,9 @@ static UINT ITERATE_CreateShortcuts(MSIRECORD *row, LPVOID param)
     target = MSI_RecordGetString(row, 5);
     if (strchrW(target, '['))
     {
-        int len;
-        WCHAR *format_string, *p;
-
-        if (!(p = strchrW( target, ']' ))) goto err;
-        len = p - target + 1;
-        format_string = msi_alloc( (len + 1) * sizeof(WCHAR) );
-        memcpy( format_string, target, len * sizeof(WCHAR) );
-        format_string[len] = 0;
-        deformat_string( package, format_string, &deformated );
-        msi_free( format_string );
-
-        path = msi_alloc( (strlenW( deformated ) + strlenW( p + 1 ) + 2) * sizeof(WCHAR) );
-        strcpyW( path, deformated );
-        PathAddBackslashW( path );
-        strcatW( path, p + 1 );
+        deformat_string( package, target, &path );
         TRACE("target path is %s\n", debugstr_w(path));
-
         IShellLinkW_SetPath( sl, path );
-        msi_free( deformated );
         msi_free( path );
     }
     else




More information about the wine-cvs mailing list