summaryrefslogtreecommitdiffstats
path: root/generic/tclEnv.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2018-10-06 19:20:43 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2018-10-06 19:20:43 (GMT)
commit99e9ce3656f195c60ba4e928559c05d47167901c (patch)
tree64fba30ebef34869f49fcdf5b36b3b41164698db /generic/tclEnv.c
parentd84d03b91a4eb72f88b56011713706a6f36bc17c (diff)
downloadtcl-99e9ce3656f195c60ba4e928559c05d47167901c.zip
tcl-99e9ce3656f195c60ba4e928559c05d47167901c.tar.gz
tcl-99e9ce3656f195c60ba4e928559c05d47167901c.tar.bz2
Use more TCL_AUTO_LENGTH, when appropriate
Diffstat (limited to 'generic/tclEnv.c')
-rw-r--r--generic/tclEnv.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/generic/tclEnv.c b/generic/tclEnv.c
index abf361b..e69fb29 100644
--- a/generic/tclEnv.c
+++ b/generic/tclEnv.c
@@ -217,7 +217,7 @@ TclSetEnv(
Tcl_MutexLock(&envMutex);
index = TclpFindVariable(name, &length);
- if (index == (size_t)-1) {
+ if (index == TCL_AUTO_LENGTH) {
#ifndef USE_PUTENV
/*
* We need to handle the case where the environment may be changed
@@ -301,7 +301,7 @@ TclSetEnv(
* string in the cache.
*/
- if ((index != (size_t)-1) && (environ[index] == p)) {
+ if ((index != TCL_AUTO_LENGTH) && (environ[index] == p)) {
ReplaceString(oldValue, p);
#ifdef HAVE_PUTENV_THAT_COPIES
} else {
@@ -417,7 +417,7 @@ TclUnsetEnv(
* needless work and to avoid recursion on the unset.
*/
- if (index == (size_t)-1) {
+ if (index == TCL_AUTO_LENGTH) {
Tcl_MutexUnlock(&envMutex);
return;
}
@@ -522,7 +522,7 @@ TclGetEnv(
Tcl_MutexLock(&envMutex);
index = TclpFindVariable(name, &length);
result = NULL;
- if (index != (size_t)-1) {
+ if (index != TCL_AUTO_LENGTH) {
Tcl_DString envStr;
result = Tcl_ExternalToUtfDString(NULL, environ[index], -1, &envStr);