VirtualBox

Changeset 41723 in vbox


Ignore:
Timestamp:
Jun 14, 2012 8:00:32 PM (12 years ago)
Author:
vboxsync
Message:

RTEnvClone: VWRN_NO_TRANSLATION -> VWRN_ENV_NOT_FULLY_TRANSLATED.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/env.h

    r41670 r41723  
    5555 * environment array.
    5656 *
    57  * @returns IPRT status code. Typical error is VERR_NO_MEMORY. Another
    58  * possible return code is VWRN_NO_TRANSLATION if EnvToClone is RTENV_DEFAULT
    59  * and there was no translation available for one environment variable. In
    60  * that case, the resulting environment will contain fewer elements than the
    61  * original environment.
     57 * @returns IPRT status code.
     58 * @retval  VWRN_ENV_NOT_FULLY_TRANSLATED may be returned when passing
     59 *          RTENV_DEFAULT and one or more of the environment variables have
     60 *          codeset incompatibilities.  The problematic variables will be
     61 *          ignored and not included in the clone, thus the clone will have
     62 *          fewer variables.
     63 * @retval  VERR_NO_MEMORY
     64 * @retval  VERR_NO_STR_MEMORY
     65 * @retval  VERR_INVALID_HANDLE
    6266 *
    6367 * @param   pEnv        Where to store the handle of the new environment block.
  • trunk/include/iprt/err.h

    r41670 r41723  
    15061506/** The specified environment variable was not found. (RTEnvUnsetEx) */
    15071507#define VINF_ENV_VAR_NOT_FOUND                  (750)
     1508/** Unable to translate all the variables in the default environment due to
     1509 * codeset issues (LANG / LC_ALL / LC_CTYPE). */
     1510#define VWRN_ENV_NOT_FULLY_TRANSLATED           (751)
    15081511/** @} */
    15091512
  • trunk/src/VBox/Runtime/generic/env-generic.cpp

    r41670 r41723  
    240240        {
    241241            /* ASSUMES the default environment is in the current codepage. */
    242             bool fNoTranslation = false;
    243             size_t iDst = 0;
     242            size_t  iDst = 0;
    244243            for (size_t iSrc = 0; iSrc < cVars; iSrc++)
    245244            {
    246245                int rc2 = RTStrCurrentCPToUtf8(&pIntEnv->papszEnv[iDst], papszEnv[iSrc]);
    247                 if (rc2 == VERR_NO_TRANSLATION)
    248                 {
    249                     fNoTranslation = true;
    250                     continue;
    251                 }
    252                 if (RT_FAILURE(rc2))
     246                if (RT_SUCCESS(rc2))
     247                    iDst++;
     248                else if (rc2 == VERR_NO_TRANSLATION)
     249                    rc = VWRN_ENV_NOT_FULLY_TRANSLATED;
     250                else
    253251                {
    254252                    pIntEnv->cVars = iDst;
     
    256254                    return rc2;
    257255                }
    258                 iDst++;
    259256            }
    260257            pIntEnv->cVars = iDst;
    261             if (fNoTranslation)
    262                 rc = VWRN_NO_TRANSLATION;
    263258        }
    264259        else
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette