Changeset 55562 in vbox
- Timestamp:
- Apr 30, 2015 3:15:15 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
-
include/iprt/env.h (modified) (4 diffs)
-
include/iprt/err.h (modified) (1 diff)
-
include/iprt/mangling.h (modified) (2 diffs)
-
src/VBox/Runtime/generic/env-generic.cpp (modified) (20 diffs)
-
src/VBox/Runtime/r3/posix/env-posix.cpp (modified) (4 diffs)
-
src/VBox/Runtime/r3/win/env-win.cpp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/env.h
r50642 r55562 158 158 * @returns IPRT status code. 159 159 * @retval VERR_ENV_VAR_NOT_FOUND if the variable was not found. 160 * 161 * @param Env The environment handle. 160 * @retval VERR_ENV_VAR_UNSET if @a hEnv is an environment change record and 161 * the variable has been recorded as unset. 162 * 163 * @param hEnv The environment handle. 162 164 * @param pszVar The environment variable name. 163 165 * @param pszValue Where to put the buffer. … … 165 167 * @param pcchActual Returns the actual value string length. Optional. 166 168 */ 167 RTDECL(int) RTEnvGetEx(RTENV Env, const char *pszVar, char *pszValue, size_t cbValue, size_t *pcchActual);169 RTDECL(int) RTEnvGetEx(RTENV hEnv, const char *pszVar, char *pszValue, size_t cbValue, size_t *pcchActual); 168 170 169 171 /** … … 276 278 * @retval VERR_BUFFER_OVERFLOW if one of the buffers are too small. We'll 277 279 * fill it with as much we can in RTStrCopy fashion. 280 * @retval VINF_ENV_VAR_UNSET if @a hEnv is an environment change record and 281 * the variable at @a iVar is recorded as being unset. 278 282 * 279 283 * @param hEnv The environment handle. … … 285 289 * @param cbValue The size of the value buffer. 286 290 */ 287 RTDECL(uint32_t) RTEnvGetByIndexEx(RTENV hEnv, uint32_t iVar, char *pszVar, size_t cbVar, char *pszValue, size_t cbValue); 291 RTDECL(int) RTEnvGetByIndexEx(RTENV hEnv, uint32_t iVar, char *pszVar, size_t cbVar, char *pszValue, size_t cbValue); 292 293 /** 294 * Leaner and meaner version of RTEnvGetByIndexEx. 295 * 296 * This can be used together with RTEnvCount to enumerate the environment block. 297 * 298 * Use with caution as the returned pointer may change by the next call using 299 * the environment handle. Please only use this API in cases where there is no 300 * chance of races. 301 * 302 * @returns Pointer to the internal environment variable=value string on 303 * success. If @a hEnv is an environment change recordthe string may 304 * also be on the "variable" form, representing an unset operation. Do 305 * NOT change this string, it is read only! 306 * 307 * If the index is out of range on the environment handle is invalid, 308 * NULL is returned. 309 * 310 * @param hEnv The environment handle. 311 * RTENV_DEFAULT is currently not accepted. 312 * @param iVar The variable index. 313 */ 314 RTDECL(const char *) RTEnvGetByIndexRawEx(RTENV hEnv, uint32_t iVar); 315 316 317 /** 318 * Creates an empty environment change record. 319 * 320 * This is a special environment for use with RTEnvApplyChanges and similar 321 * purposes. The 322 * 323 * @returns IPRT status code. Typical error is VERR_NO_MEMORY. 324 * 325 * @param phEnv Where to store the handle of the new environment block. 326 */ 327 RTDECL(int) RTEnvCreateChangeRecord(PRTENV phEnv); 328 329 /** 330 * Checks if @a hEnv is an environment change record. 331 * 332 * @returns true if it is, false if it's not or if the handle is invalid. 333 * @param hEnv The environment handle. 334 * @sa RTEnvCreateChangeRecord. 335 */ 336 RTDECL(bool) RTEnvIsChangeRecord(RTENV hEnv); 337 338 /** 339 * Applies changes from one environment onto another. 340 * 341 * If @a hEnvChanges is a normal environment, its content is just added to @a 342 * hEnvDst, where variables in the destination can only be overwritten. However 343 * if @a hEnvChanges is a change record environment, variables in the 344 * destination can also be removed. 345 * 346 * @returns IPRT status code. Typical error is VERR_NO_MEMORY. 347 * @param hEnvDst The destination environment. 348 * @param hEnvChanges Handle to the environment containig the changes to 349 * apply. As said, especially useful if it's a environment 350 * change record. RTENV_DEFAULT is not supported here. 351 */ 352 RTDECL(int) RTEnvApplyChanges(RTENV hEnvDst, RTENV hEnvChanges); 353 288 354 289 355 #endif /* IN_RING3 */ -
trunk/include/iprt/err.h
r55161 r55562 1600 1600 * codeset issues (LANG / LC_ALL / LC_CTYPE). */ 1601 1601 #define VWRN_ENV_NOT_FULLY_TRANSLATED (751) 1602 /** Invalid environment variable name. */ 1603 #define VERR_ENV_INVALID_VAR_NAME (-752) 1604 /** The environment variable is an unset record. */ 1605 #define VINF_ENV_VAR_UNSET (753) 1606 /** The environment variable has been recorded as being unset. */ 1607 #define VERR_ENV_VAR_UNSET (-753) 1602 1608 /** @} */ 1603 1609 -
trunk/include/iprt/mangling.h
r55313 r55562 508 508 # define RTDvmVolumeTypeGetDescr RT_MANGLER(RTDvmVolumeTypeGetDescr) 509 509 # define RTDvmVolumeCreateVfsFile RT_MANGLER(RTDvmVolumeCreateVfsFile) 510 # define RTEnvApplyChanges RT_MANGLER(RTEnvApplyChanges) 510 511 # define RTEnvClone RT_MANGLER(RTEnvClone) 511 512 # define RTEnvCountEx RT_MANGLER(RTEnvCountEx) 512 513 # define RTEnvCreate RT_MANGLER(RTEnvCreate) 514 # define RTEnvCreateChangeRecord RT_MANGLER(RTEnvCreateChangeRecord) 513 515 # define RTEnvDestroy RT_MANGLER(RTEnvDestroy) 514 516 # define RTEnvDupEx RT_MANGLER(RTEnvDupEx) … … 521 523 # define RTEnvGetBad RT_MANGLER(RTEnvGetBad) 522 524 # define RTEnvGetByIndexEx RT_MANGLER(RTEnvGetByIndexEx) 525 # define RTEnvGetByIndexRawEx RT_MANGLER(RTEnvGetByIndexRawEx) 523 526 # define RTEnvGetUtf8 RT_MANGLER(RTEnvGetUtf8) 524 527 # define RTEnvGetEx RT_MANGLER(RTEnvGetEx) 525 528 # define RTEnvGetExecEnvP RT_MANGLER(RTEnvGetExecEnvP) 529 # define RTEnvIsChangeRecord RT_MANGLER(RTEnvIsChangeRecord) 526 530 # define RTEnvPut RT_MANGLER(RTEnvPut) 527 531 # define RTEnvPutBad RT_MANGLER(RTEnvPutBad) -
trunk/src/VBox/Runtime/generic/env-generic.cpp
r50644 r55562 89 89 /** Magic value . */ 90 90 uint32_t u32Magic; 91 /** Set if this is a record of environment changes, putenv style. */ 92 bool fPutEnvBlock; 91 93 /** Number of variables in the array. 92 94 * This does not include the terminating NULL entry. */ … … 96 98 * with the C library), so that c <= cCapacity - 1. */ 97 99 size_t cAllocated; 98 /** Array of environment variables. */ 100 /** Array of environment variables. 101 * These are always in "NAME=VALUE" form, where the value can be empty. If 102 * fPutEnvBlock is set though, there will be "NAME" entries too for variables 103 * that need to be removed when merged with another environment block. */ 99 104 char **papszEnv; 100 105 /** Array of environment variables in the process CP. … … 132 137 * @param fCaseSensitive Whether the environment block is case sensitive or 133 138 * not. 139 * @param fPutEnvBlock Indicates whether this is a special environment 140 * block that will be used to record change another 141 * block. We will keep unsets in putenv format, i.e. 142 * just the variable name without any equal sign. 134 143 */ 135 static int rtEnvCreate(PRTENVINTERNAL *ppIntEnv, size_t cAllocated, bool fCaseSensitive )144 static int rtEnvCreate(PRTENVINTERNAL *ppIntEnv, size_t cAllocated, bool fCaseSensitive, bool fPutEnvBlock) 136 145 { 137 146 /* … … 145 154 */ 146 155 pIntEnv->u32Magic = RTENV_MAGIC; 156 pIntEnv->fPutEnvBlock = fPutEnvBlock; 147 157 pIntEnv->pfnCompare = fCaseSensitive ? RTStrNCmp : RTStrNICmp; 148 158 pIntEnv->papszEnvOtherCP = NULL; … … 166 176 { 167 177 AssertPtrReturn(pEnv, VERR_INVALID_POINTER); 168 return rtEnvCreate(pEnv, RTENV_GROW_SIZE, false /*fCaseSensitive*/ );178 return rtEnvCreate(pEnv, RTENV_GROW_SIZE, false /*fCaseSensitive*/, false /*fPutEnvBlock*/); 169 179 } 170 180 RT_EXPORT_SYMBOL(RTEnvCreate); … … 221 231 */ 222 232 bool fCaseSensitive = true; 233 bool fPutEnvBlock = false; 223 234 size_t cVars; 224 235 const char * const *papszEnv; … … 263 274 RTENV_LOCK(pIntEnvToClone); 264 275 276 fPutEnvBlock = pIntEnvToClone->fPutEnvBlock; 265 277 papszEnv = pIntEnvToClone->papszEnv; 266 278 cVars = pIntEnvToClone->cVars; … … 271 283 */ 272 284 PRTENVINTERNAL pIntEnv; 273 int rc = rtEnvCreate(&pIntEnv, cVars + 1 /* NULL */, fCaseSensitive );285 int rc = rtEnvCreate(&pIntEnv, cVars + 1 /* NULL */, fCaseSensitive, fPutEnvBlock); 274 286 if (RT_SUCCESS(rc)) 275 287 { … … 288 300 #endif 289 301 if (RT_SUCCESS(rc2)) 302 { 303 /* Make sure it contains an '='. */ 290 304 iDst++; 305 if (strchr(pIntEnv->papszEnv[iDst - 1], '=')) 306 continue; 307 rc2 = RTStrAAppend(&pIntEnv->papszEnv[iDst - 1], "="); 308 if (RT_SUCCESS(rc2)) 309 continue; 310 } 291 311 else if (rc2 == VERR_NO_TRANSLATION) 312 { 292 313 rc = VWRN_ENV_NOT_FULLY_TRANSLATED; 293 else 294 { 295 pIntEnv->cVars = iDst; 296 RTEnvDestroy(pIntEnv); 297 return rc2; 298 } 314 continue; 315 } 316 317 /* failed fatally. */ 318 pIntEnv->cVars = iDst; 319 RTEnvDestroy(pIntEnv); 320 return rc2; 299 321 } 300 322 pIntEnv->cVars = iDst; … … 361 383 AssertReturn(*pszVar, VERR_INVALID_PARAMETER); 362 384 AssertPtrReturn(pszValue, VERR_INVALID_POINTER); 385 AssertReturn(strchr(pszVar, '=') == NULL, VERR_ENV_INVALID_VAR_NAME); 363 386 364 387 int rc; … … 415 438 for (iVar = 0; iVar < pIntEnv->cVars; iVar++) 416 439 if ( !pIntEnv->pfnCompare(pIntEnv->papszEnv[iVar], pszVar, cchVar) 417 && pIntEnv->papszEnv[iVar][cchVar] == '=') 440 && ( pIntEnv->papszEnv[iVar][cchVar] == '=' 441 || pIntEnv->papszEnv[iVar][cchVar] == '\0') ) 418 442 break; 419 443 if (iVar < pIntEnv->cVars) … … 470 494 AssertPtrReturn(pszVar, VERR_INVALID_POINTER); 471 495 AssertReturn(*pszVar, VERR_INVALID_PARAMETER); 496 AssertReturn(strchr(pszVar, '=') == NULL, VERR_ENV_INVALID_VAR_NAME); 472 497 473 498 int rc; … … 507 532 for (iVar = 0; iVar < pIntEnv->cVars; iVar++) 508 533 if ( !pIntEnv->pfnCompare(pIntEnv->papszEnv[iVar], pszVar, cchVar) 509 && pIntEnv->papszEnv[iVar][cchVar] == '=') 510 { 511 RTMemFree(pIntEnv->papszEnv[iVar]); 512 pIntEnv->cVars--; 513 if (pIntEnv->cVars > 0) 514 pIntEnv->papszEnv[iVar] = pIntEnv->papszEnv[pIntEnv->cVars]; 515 pIntEnv->papszEnv[pIntEnv->cVars] = NULL; 534 && ( pIntEnv->papszEnv[iVar][cchVar] == '=' 535 || pIntEnv->papszEnv[iVar][cchVar] == '\0') ) 536 { 537 if (!pIntEnv->fPutEnvBlock) 538 { 539 RTMemFree(pIntEnv->papszEnv[iVar]); 540 pIntEnv->cVars--; 541 if (pIntEnv->cVars > 0) 542 pIntEnv->papszEnv[iVar] = pIntEnv->papszEnv[pIntEnv->cVars]; 543 pIntEnv->papszEnv[pIntEnv->cVars] = NULL; 544 } 545 else 546 { 547 /* Record this unset by keeping the variable without any equal sign. */ 548 pIntEnv->papszEnv[iVar][cchVar] = '\0'; 549 } 516 550 rc = VINF_SUCCESS; 517 551 /* no break, there could be more. */ … … 532 566 AssertPtrNullReturn(pcchActual, VERR_INVALID_POINTER); 533 567 AssertReturn(pcchActual || (pszValue && cbValue), VERR_INVALID_PARAMETER); 568 AssertReturn(strchr(pszVar, '=') == NULL, VERR_ENV_INVALID_VAR_NAME); 534 569 535 570 if (pcchActual) … … 592 627 size_t iVar; 593 628 for (iVar = 0; iVar < pIntEnv->cVars; iVar++) 594 if ( !pIntEnv->pfnCompare(pIntEnv->papszEnv[iVar], pszVar, cchVar) 595 && pIntEnv->papszEnv[iVar][cchVar] == '=') 596 { 597 rc = VINF_SUCCESS; 598 const char *pszValueOrg = pIntEnv->papszEnv[iVar] + cchVar + 1; 599 size_t cch = strlen(pszValueOrg); 600 if (pcchActual) 601 *pcchActual = cch; 602 if (pszValue && cbValue) 603 { 604 if (cch < cbValue) 605 memcpy(pszValue, pszValueOrg, cch + 1); 606 else 607 rc = VERR_BUFFER_OVERFLOW; 608 } 609 break; 629 if (!pIntEnv->pfnCompare(pIntEnv->papszEnv[iVar], pszVar, cchVar)) 630 { 631 if (pIntEnv->papszEnv[iVar][cchVar] == '=') 632 { 633 rc = VINF_SUCCESS; 634 const char *pszValueOrg = pIntEnv->papszEnv[iVar] + cchVar + 1; 635 size_t cch = strlen(pszValueOrg); 636 if (pcchActual) 637 *pcchActual = cch; 638 if (pszValue && cbValue) 639 { 640 if (cch < cbValue) 641 memcpy(pszValue, pszValueOrg, cch + 1); 642 else 643 rc = VERR_BUFFER_OVERFLOW; 644 } 645 break; 646 } 647 if (pIntEnv->papszEnv[iVar][cchVar] == '\0') 648 { 649 Assert(pIntEnv->fPutEnvBlock); 650 rc = VERR_ENV_VAR_UNSET; 651 break; 652 } 610 653 } 611 654 … … 654 697 const size_t cchVar = strlen(pszVar); 655 698 for (size_t iVar = 0; iVar < pIntEnv->cVars; iVar++) 656 if ( !pIntEnv->pfnCompare(pIntEnv->papszEnv[iVar], pszVar, cchVar) 657 && pIntEnv->papszEnv[iVar][cchVar] == '=') 658 { 659 fExists = true; 660 break; 699 if (!pIntEnv->pfnCompare(pIntEnv->papszEnv[iVar], pszVar, cchVar)) 700 { 701 if (pIntEnv->papszEnv[iVar][cchVar] == '=') 702 { 703 fExists = true; 704 break; 705 } 706 if (pIntEnv->papszEnv[iVar][cchVar] == '\0') 707 break; 661 708 } 662 709 … … 740 787 * @param pvUser Ignored. 741 788 */ 742 DECLCALLBACK(int) rtEnvSortCompare(const void *pvElement1, const void *pvElement2, void *pvUser)789 static DECLCALLBACK(int) rtEnvSortCompare(const void *pvElement1, const void *pvElement2, void *pvUser) 743 790 { 744 791 NOREF(pvUser); … … 863 910 864 911 865 RTDECL( uint32_t) RTEnvGetByIndexEx(RTENV hEnv, uint32_t iVar, char *pszVar, size_t cbVar, char *pszValue, size_t cbValue)912 RTDECL(int) RTEnvGetByIndexEx(RTENV hEnv, uint32_t iVar, char *pszVar, size_t cbVar, char *pszValue, size_t cbValue) 866 913 { 867 914 PRTENVINTERNAL pIntEnv = hEnv; … … 882 929 bool fHasEqual = pszSrcValue != NULL; 883 930 if (pszSrcValue) 931 { 884 932 pszSrcValue++; 933 rc = VINF_SUCCESS; 934 } 885 935 else 936 { 886 937 pszSrcValue = strchr(pszSrcVar, '\0'); 887 rc = VINF_SUCCESS; 938 rc = VINF_ENV_VAR_UNSET; 939 } 888 940 if (cbVar) 889 rc = RTStrCopyEx(pszVar, cbVar, pszSrcVar, pszSrcValue - pszSrcVar - fHasEqual); 941 { 942 int rc2 = RTStrCopyEx(pszVar, cbVar, pszSrcVar, pszSrcValue - pszSrcVar - fHasEqual); 943 if (RT_FAILURE(rc2)) 944 rc = rc2; 945 } 890 946 if (cbValue) 891 947 { … … 904 960 RT_EXPORT_SYMBOL(RTEnvGetByIndexEx); 905 961 962 963 RTDECL(const char *) RTEnvGetByIndexRawEx(RTENV hEnv, uint32_t iVar) 964 { 965 PRTENVINTERNAL pIntEnv = hEnv; 966 AssertPtrReturn(pIntEnv, NULL); 967 AssertReturn(pIntEnv->u32Magic == RTENV_MAGIC, NULL); 968 969 RTENV_LOCK(pIntEnv); 970 971 const char *pszRet; 972 if (iVar < pIntEnv->cVars) 973 pszRet = pIntEnv->papszEnv[iVar]; 974 else 975 pszRet = NULL; 976 977 RTENV_UNLOCK(pIntEnv); 978 979 return pszRet; 980 } 981 RT_EXPORT_SYMBOL(RTEnvGetByIndexRawEx); 982 983 984 RTDECL(int) RTEnvCreateChangeRecord(PRTENV phEnv) 985 { 986 AssertPtrReturn(phEnv, VERR_INVALID_POINTER); 987 return rtEnvCreate(phEnv, RTENV_GROW_SIZE, false /*fCaseSensitive*/, true /*fPutEnvBlock*/); 988 } 989 RT_EXPORT_SYMBOL(RTEnvCreateChangeRecord); 990 991 992 RTDECL(bool) RTEnvIsChangeRecord(RTENV hEnv) 993 { 994 if (hEnv == RTENV_DEFAULT) 995 return false; 996 997 PRTENVINTERNAL pIntEnv = hEnv; 998 AssertPtrReturn(pIntEnv, false); 999 AssertReturn(pIntEnv->u32Magic == RTENV_MAGIC, false); 1000 return pIntEnv->fPutEnvBlock; 1001 } 1002 RT_EXPORT_SYMBOL(RTEnvIsChangeRecord); 1003 1004 1005 RTDECL(int) RTEnvApplyChanges(RTENV hEnvDst, RTENV hEnvChanges) 1006 { 1007 PRTENVINTERNAL pIntEnvChanges = hEnvChanges; 1008 AssertPtrReturn(pIntEnvChanges, VERR_INVALID_HANDLE); 1009 AssertReturn(pIntEnvChanges->u32Magic == RTENV_MAGIC, VERR_INVALID_HANDLE); 1010 1011 /** @todo lock validator trouble ahead here! */ 1012 RTENV_LOCK(pIntEnvChanges); 1013 1014 int rc = VINF_SUCCESS; 1015 for (uint32_t iChange = 0; iChange < pIntEnvChanges->cVars && RT_SUCCESS(rc); iChange++) 1016 rc = RTEnvPutEx(hEnvDst, pIntEnvChanges->papszEnv[iChange]); 1017 1018 RTENV_UNLOCK(pIntEnvChanges); 1019 1020 return rc; 1021 } 1022 RT_EXPORT_SYMBOL(RTEnvApplyChanges); 1023 -
trunk/src/VBox/Runtime/r3/posix/env-posix.cpp
r50408 r55562 49 49 RTDECL(bool) RTEnvExistsBad(const char *pszVar) 50 50 { 51 AssertReturn(strchr(pszVar, '=') == NULL, false); 51 52 return RTEnvGetBad(pszVar) != NULL; 52 53 } … … 61 62 RTDECL(const char *) RTEnvGetBad(const char *pszVar) 62 63 { 64 AssertReturn(strchr(pszVar, '=') == NULL, NULL); 65 63 66 IPRT_ALIGNMENT_CHECKS_DISABLE(); /* glibc causes trouble */ 64 67 const char *pszValue = getenv(pszVar); … … 91 94 RTDECL(int) RTEnvSetBad(const char *pszVar, const char *pszValue) 92 95 { 96 AssertMsgReturn(strchr(pszVar, '=') == NULL, ("'%s'\n", pszVar), VERR_ENV_INVALID_VAR_NAME); 97 93 98 #if defined(_MSC_VER) 94 99 /* make a local copy and feed it to putenv. */ … … 125 130 RTDECL(int) RTEnvUnsetBad(const char *pszVar) 126 131 { 127 AssertReturn( !strchr(pszVar, '='), VERR_INVALID_PARAMETER);132 AssertReturn(strchr(pszVar, '=') == NULL, VERR_ENV_INVALID_VAR_NAME); 128 133 129 134 /* -
trunk/src/VBox/Runtime/r3/win/env-win.cpp
r50408 r55562 54 54 RTDECL(bool) RTEnvExistsUtf8(const char *pszVar) 55 55 { 56 AssertReturn(strchr(pszVar, '=') == NULL, false); 57 56 58 PRTUTF16 pwszVar; 57 59 int rc = RTStrToUtf16(pszVar, &pwszVar); … … 65 67 RTDECL(const char *) RTEnvGetBad(const char *pszVar) 66 68 { 69 AssertReturn(strchr(pszVar, '=') == NULL, NULL); 67 70 return getenv(pszVar); 68 71 } … … 81 84 AssertPtrNullReturn(pcchActual, VERR_INVALID_POINTER); 82 85 AssertReturn(pcchActual || (pszValue && cbValue), VERR_INVALID_PARAMETER); 86 AssertReturn(strchr(pszVar, '=') == NULL, VERR_ENV_INVALID_VAR_NAME); 83 87 84 88 if (pcchActual) … … 87 91 PRTUTF16 pwszVar; 88 92 int rc = RTStrToUtf16(pszVar, &pwszVar); 89 AssertRCReturn(rc, false);93 AssertRCReturn(rc, rc); 90 94 91 95 /** @todo Consider _wgetenv_s or GetEnvironmentVariableW here to avoid the … … 140 144 RTDECL(int) RTEnvSetBad(const char *pszVar, const char *pszValue) 141 145 { 146 AssertMsgReturn(strchr(pszVar, '=') == NULL, ("'%s'\n", pszVar), VERR_ENV_INVALID_VAR_NAME); 147 142 148 /* make a local copy and feed it to putenv. */ 143 149 const size_t cchVar = strlen(pszVar); … … 167 173 RTDECL(int) RTEnvSetUtf8(const char *pszVar, const char *pszValue) 168 174 { 175 AssertReturn(strchr(pszVar, '=') == NULL, VERR_ENV_INVALID_VAR_NAME); 176 169 177 size_t cwcVar; 170 178 int rc = RTStrCalcUtf16LenEx(pszVar, RTSTR_MAX, &cwcVar); … … 204 212 RTDECL(int) RTEnvUnsetBad(const char *pszVar) 205 213 { 206 AssertReturn( !strchr(pszVar, '='), VERR_INVALID_PARAMETER);214 AssertReturn(strchr(pszVar, '=') == NULL, VERR_ENV_INVALID_VAR_NAME); 207 215 208 216 /* … … 244 252 RTDECL(int) RTEnvUnsetUtf8(const char *pszVar) 245 253 { 254 AssertReturn(strchr(pszVar, '=') == NULL, VERR_ENV_INVALID_VAR_NAME); 255 246 256 size_t cwcVar; 247 257 int rc = RTStrCalcUtf16LenEx(pszVar, RTSTR_MAX, &cwcVar);
Note:
See TracChangeset
for help on using the changeset viewer.

