~ubuntu-wine/ubuntu/lucid/wine1.2/wine1.2+winepulse

« back to all changes in this revision

Viewing changes to dlls/msi/action.c

  • Committer: Bazaar Package Importer
  • Author(s): Scott Ritchie
  • Date: 2010-02-02 11:15:03 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20100202111503-w4ayji21ei1ginjr
Tags: 1.1.37-0ubuntu1
* New upstream release
  - A number of fixes in AVI file support.
  - Several MSXML improvements.
  - A few MSI fixes.
  - Various bug fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1562
1562
 
1563
1563
            while (ptr)
1564
1564
            {
1565
 
                if ((ptr2 && strncmpW(ptr,feature->Feature, ptr2-ptr)==0)
1566
 
                    || (!ptr2 && strcmpW(ptr,feature->Feature)==0))
 
1565
                int len = ptr2 - ptr;
 
1566
 
 
1567
                if ((ptr2 && strlenW(feature->Feature) == len && !strncmpW(ptr, feature->Feature, len))
 
1568
                    || (!ptr2 && !strcmpW(ptr, feature->Feature)))
1567
1569
                {
1568
1570
                    msi_feature_set_state(package, feature, state);
1569
1571
                    break;
4922
4924
        LPCWSTR ptr = *value;
4923
4925
        if (!strncmpW(ptr, prefix, prefix_len))
4924
4926
        {
4925
 
            *flags |= ENV_MOD_APPEND;
4926
 
            *value += lstrlenW(prefix);
 
4927
            if (ptr[prefix_len] == szSemiColon[0])
 
4928
            {
 
4929
                *flags |= ENV_MOD_APPEND;
 
4930
                *value += lstrlenW(prefix);
 
4931
            }
 
4932
            else
 
4933
            {
 
4934
                *value = NULL;
 
4935
            }
4927
4936
        }
4928
4937
        else if (lstrlenW(*value) >= prefix_len)
4929
4938
        {
4930
4939
            ptr += lstrlenW(ptr) - prefix_len;
4931
4940
            if (!lstrcmpW(ptr, prefix))
4932
4941
            {
4933
 
                *flags |= ENV_MOD_PREFIX;
4934
 
                /* the "[~]" will be removed by deformat_string */;
 
4942
                if ((ptr-1) > *value && *(ptr-1) == szSemiColon[0])
 
4943
                {
 
4944
                    *flags |= ENV_MOD_PREFIX;
 
4945
                    /* the "[~]" will be removed by deformat_string */;
 
4946
                }
 
4947
                else
 
4948
                {
 
4949
                    *value = NULL;
 
4950
                }
4935
4951
            }
4936
4952
        }
4937
4953
    }
4977
4993
    TRACE("name %s value %s\n", debugstr_w(name), debugstr_w(value));
4978
4994
 
4979
4995
    res = env_set_flags(&name, &value, &flags);
4980
 
    if (res != ERROR_SUCCESS)
 
4996
    if (res != ERROR_SUCCESS || !value)
4981
4997
       goto done;
4982
4998
 
4983
4999
    if (value && !deformat_string(package, value, &deformatted))
5023
5039
            goto done;
5024
5040
        }
5025
5041
 
 
5042
        /* If we are appending but the string was empty, strip ; */
 
5043
        if ((flags & ENV_MOD_APPEND) && (value[0] == szSemiColon[0])) value++;
 
5044
 
5026
5045
        size = (lstrlenW(value) + 1) * sizeof(WCHAR);
5027
5046
        newval = strdupW(value);
5028
5047
        if (!newval)
5033
5052
    }
5034
5053
    else
5035
5054
    {
5036
 
        if (flags & ENV_ACT_SETABSENT)
 
5055
        /* Contrary to MSDN, +-variable to [~];path works */
 
5056
        if (flags & ENV_ACT_SETABSENT && !(flags & ENV_MOD_MASK))
5037
5057
        {
5038
5058
            res = ERROR_SUCCESS;
5039
5059
            goto done;
5063
5083
            int multiplier = 0;
5064
5084
            if (flags & ENV_MOD_APPEND) multiplier++;
5065
5085
            if (flags & ENV_MOD_PREFIX) multiplier++;
5066
 
            mod_size = (lstrlenW(value) + 1) * multiplier;
 
5086
            mod_size = lstrlenW(value) * multiplier;
5067
5087
            size += mod_size * sizeof(WCHAR);
5068
5088
        }
5069
5089
 
5078
5098
        if (flags & ENV_MOD_PREFIX)
5079
5099
        {
5080
5100
            lstrcpyW(newval, value);
5081
 
            lstrcatW(newval, szSemiColon);
5082
 
            ptr = newval + lstrlenW(value) + 1;
 
5101
            ptr = newval + lstrlenW(value);
5083
5102
        }
5084
5103
 
5085
5104
        lstrcpyW(ptr, data);
5086
5105
 
5087
5106
        if (flags & ENV_MOD_APPEND)
5088
5107
        {
5089
 
            lstrcatW(newval, szSemiColon);
5090
5108
            lstrcatW(newval, value);
5091
5109
        }
5092
5110
    }