Changeset 41723 in vbox
- Timestamp:
- Jun 14, 2012 8:00:32 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
include/iprt/env.h (modified) (1 diff)
-
include/iprt/err.h (modified) (1 diff)
-
src/VBox/Runtime/generic/env-generic.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/env.h
r41670 r41723 55 55 * environment array. 56 56 * 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 62 66 * 63 67 * @param pEnv Where to store the handle of the new environment block. -
trunk/include/iprt/err.h
r41670 r41723 1506 1506 /** The specified environment variable was not found. (RTEnvUnsetEx) */ 1507 1507 #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) 1508 1511 /** @} */ 1509 1512 -
trunk/src/VBox/Runtime/generic/env-generic.cpp
r41670 r41723 240 240 { 241 241 /* ASSUMES the default environment is in the current codepage. */ 242 bool fNoTranslation = false; 243 size_t iDst = 0; 242 size_t iDst = 0; 244 243 for (size_t iSrc = 0; iSrc < cVars; iSrc++) 245 244 { 246 245 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 253 251 { 254 252 pIntEnv->cVars = iDst; … … 256 254 return rc2; 257 255 } 258 iDst++;259 256 } 260 257 pIntEnv->cVars = iDst; 261 if (fNoTranslation)262 rc = VWRN_NO_TRANSLATION;263 258 } 264 259 else
Note:
See TracChangeset
for help on using the changeset viewer.

