Changeset 279 for trunk/src/cppbase


Ignore:
Timestamp:
Mar 6, 2005, 9:02:21 PM (20 years ago)
Author:
pr
Message:

Fix for CLEARPROFILE and WRITEPROFILE. Bug 633.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/cppbase/bs_config.cpp

    r276 r279  
    18041804 *      Syntax:
    18051805 *
    1806  +          CLEARPROFILE="profile[\application[\key]]"
     1806 +          CLEARPROFILE="profile\application[\key]"
    18071807 *
    18081808 *@@added V0.9.1 (2000-02-07) [umoeller]
     1809 *@@changed V1.0.5 (2005-03-06) [pr]: Improved parsing of profiles with path names. @@fixes 633
    18091810 */
    18101811
     
    18211822        _ustrProfile.assignUtf8(pcszClearProfile, pFirstBackslash);
    18221823
     1824        if (   _ustrProfile.compareUtf8("USER")
     1825            && _ustrProfile.compareUtf8("SYSTEM")
     1826           )
     1827        {
     1828            while (pFirstBackslash)
     1829            {
     1830                ULONG cbProfile = pFirstBackslash - pcszClearProfile;
     1831                if (   (cbProfile > 4)
     1832                    && (!strnicmp(pFirstBackslash - 4, ".INI", 4))
     1833                   )
     1834                {
     1835                    _ustrProfile.assignUtf8(pcszClearProfile, pFirstBackslash);
     1836                    break;
     1837                }
     1838
     1839                pFirstBackslash = strchr(pFirstBackslash + 1, '\\');
     1840            }
     1841        }
     1842    }
     1843
     1844    if (pFirstBackslash)
     1845    {
    18231846        // get application
    18241847        PCSZ pSecondBackslash;
     
    18371860    }
    18381861
    1839     if (    (!_ustrProfile())
    1840          || (!_ustrApplication())
    1841        )
     1862    if (!_ustrApplication())
    18421863        // any error:
    18431864        throw BSConfigExcpt(PRFEXCPT_SYNTAX, ustrClearProfile);
     
    19721993 *@@added V0.9.1 (2000-02-07) [umoeller]
    19731994 *@@changed V0.9.19 (2002-05-07) [umoeller]: added missing class init, now writeprofiles work again
     1995 *@@changed V1.0.5 (2005-03-06) [pr]: Improved parsing of profiles with path names. @@fixes 633
    19741996 */
    19751997
     
    19972019            _ustrProfile.assignUtf8(pcszWriteProfile, pFirstBackslash);
    19982020
     2021            if (   _ustrProfile.compareUtf8("USER")
     2022                && _ustrProfile.compareUtf8("SYSTEM")
     2023               )
     2024            {
     2025                while (pFirstBackslash)
     2026                {
     2027                    ULONG cbProfile = pFirstBackslash - pcszWriteProfile;
     2028                    if (   (cbProfile > 4)
     2029                        && (!strnicmp(pFirstBackslash - 4, ".INI", 4))
     2030                        && (pFirstBackslash < pSlash)
     2031                       )
     2032                    {
     2033                        _ustrProfile.assignUtf8(pcszWriteProfile, pFirstBackslash);
     2034                        break;
     2035                    }
     2036
     2037                    pFirstBackslash = strchr(pFirstBackslash + 1, '\\');
     2038                }
     2039            }
     2040        }
     2041
     2042        if (pFirstBackslash)
     2043        {
    19992044            // get application
    20002045            PCSZ pSecondBackslash;
Note: See TracChangeset for help on using the changeset viewer.