summaryrefslogtreecommitdiffstats
path: root/generic/tclEnv.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2002-01-25 20:40:54 (GMT)
committerdgp <dgp@users.sourceforge.net>2002-01-25 20:40:54 (GMT)
commit7bb89f954aeb2e32b07d01513217ab6930f80ccf (patch)
tree90cd60706107518bc582921a1eb262224b8dac22 /generic/tclEnv.c
parente987f887ebf5997e0c4461c254ec85e39a7b0b46 (diff)
downloadtcl-7bb89f954aeb2e32b07d01513217ab6930f80ccf.zip
tcl-7bb89f954aeb2e32b07d01513217ab6930f80ccf.tar.gz
tcl-7bb89f954aeb2e32b07d01513217ab6930f80ccf.tar.bz2
* Updated interfaces of generic/tclEncoding, generic/tclFilename.c,
generic/tclIOUtil.c, generic/tclPipe.c, generic/tclResult.c, generic/tclUtil.c, generic/tclVar.c and mac/tclMacResource.c according to TIP 27. Tcl_TranslateFileName rewritten as wrapper around VFS-aware version. Updated callers. ***POTENTIAL INCOMPATIBILITY*** Includes source incompatibilities: argv arguments of Tcl_Concat, Tcl_JoinPath, Tcl_OpenCommandChannel, Tcl_Merge; argvPtr arguments of Tcl_SplitList and Tcl_SplitPath.
Diffstat (limited to 'generic/tclEnv.c')
-rw-r--r--generic/tclEnv.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/generic/tclEnv.c b/generic/tclEnv.c
index 1650ed2..35fa180 100644
--- a/generic/tclEnv.c
+++ b/generic/tclEnv.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclEnv.c,v 1.9 2000/08/11 17:42:41 ericm Exp $
+ * RCS: @(#) $Id: tclEnv.c,v 1.10 2002/01/25 20:40:55 dgp Exp $
*/
#include "tclInt.h"
@@ -84,7 +84,8 @@ TclSetupEnv(interp)
* managed. */
{
Tcl_DString envString;
- char *p1, *p2;
+ CONST char *p1;
+ char *p2;
int i;
/*
@@ -133,7 +134,8 @@ TclSetupEnv(interp)
}
p2++;
p2[-1] = '\0';
- Tcl_SetVar2(interp, "env", p1, p2, TCL_GLOBAL_ONLY);
+ Tcl_SetVar2(interp, "env", Tcl_DStringValue(&envString), p2,
+ TCL_GLOBAL_ONLY);
Tcl_DStringFree(&envString);
}
Tcl_MutexUnlock(&envMutex);
@@ -174,7 +176,8 @@ TclSetEnv(name, value)
{
Tcl_DString envString;
int index, length, nameLength;
- char *p, *p2, *oldValue;
+ char *p, *oldValue;
+ CONST char *p2;
/*
* Figure out where the entry is going to go. If the name doesn't
@@ -206,7 +209,7 @@ TclSetEnv(name, value)
oldValue = NULL;
nameLength = strlen(name);
} else {
- char *env;
+ CONST char *env;
/*
* Compare the new value to the existing value. If they're
@@ -303,7 +306,8 @@ Tcl_PutEnv(string)
{
Tcl_DString nameString;
int nameLength;
- char *name, *value;
+ CONST char *name;
+ char *value;
if (string == NULL) {
return 0;
@@ -443,7 +447,7 @@ TclUnsetEnv(name)
*----------------------------------------------------------------------
*/
-char *
+CONST char *
TclGetEnv(name, valuePtr)
CONST char *name; /* Name of environment variable to find
* (UTF-8). */
@@ -452,7 +456,7 @@ TclGetEnv(name, valuePtr)
* stored. */
{
int length, index;
- char *result;
+ CONST char *result;
Tcl_MutexLock(&envMutex);
index = TclpFindVariable(name, &length);
@@ -530,7 +534,7 @@ EnvTraceProc(clientData, interp, name1, name2, flags)
*/
if (flags & TCL_TRACE_WRITES) {
- char *value;
+ CONST char *value;
value = Tcl_GetVar2(interp, "env", name2, TCL_GLOBAL_ONLY);
TclSetEnv(name2, value);
@@ -542,7 +546,7 @@ EnvTraceProc(clientData, interp, name1, name2, flags)
if (flags & TCL_TRACE_READS) {
Tcl_DString valueString;
- char *value;
+ CONST char *value;
value = TclGetEnv(name2, &valueString);
if (value == NULL) {