diff options
Diffstat (limited to 'unix')
-rw-r--r-- | unix/tclUnixFCmd.c | 4 | ||||
-rw-r--r-- | unix/tclUnixFile.c | 14 | ||||
-rw-r--r-- | unix/tclUnixInit.c | 14 | ||||
-rw-r--r-- | unix/tclUnixPipe.c | 12 |
4 files changed, 23 insertions, 21 deletions
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c index ee76818..a48c2ee 100644 --- a/unix/tclUnixFCmd.c +++ b/unix/tclUnixFCmd.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixFCmd.c,v 1.14 2002/01/17 04:37:33 dgp Exp $ + * RCS: @(#) $Id: tclUnixFCmd.c,v 1.15 2002/01/25 20:40:56 dgp Exp $ * * Portions of this code were derived from NetBSD source code which has * the following copyright notice: @@ -1647,7 +1647,7 @@ TclpObjNormalizePath(interp, pathPtr, nextCheckpoint) if ((cur == '/' || cur == 0) && (path != currentPathEndPosition)) { /* Reached directory separator, or end of string */ Tcl_DString ds; - char *nativePath; + CONST char *nativePath; int accessOk; nativePath = Tcl_UtfToExternalDString(NULL, path, diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c index eb215c9..031ece8 100644 --- a/unix/tclUnixFile.c +++ b/unix/tclUnixFile.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixFile.c,v 1.14 2002/01/17 04:37:33 dgp Exp $ + * RCS: @(#) $Id: tclUnixFile.c,v 1.15 2002/01/25 20:40:56 dgp Exp $ */ #include "tclInt.h" @@ -196,12 +196,12 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types) Tcl_Interp *interp; /* Interpreter to receive errors. */ Tcl_Obj *resultPtr; /* List object to lappend results. */ Tcl_Obj *pathPtr; /* Contains path to directory to search. */ - char *pattern; /* Pattern to match against. */ + CONST char *pattern; /* Pattern to match against. */ Tcl_GlobTypeData *types; /* Object containing list of acceptable types. * May be NULL. In particular the directory * flag is very important. */ { - char *native, *fname, *dirName; + CONST char *native, *fname, *dirName; DIR *d; Tcl_DString ds; struct stat statBuf; @@ -294,7 +294,7 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types) while (1) { Tcl_DString utfDs; - char *utf; + CONST char *utf; struct dirent *entryPtr; entryPtr = readdir(d); /* INTL: Native. */ @@ -460,7 +460,7 @@ TclpGetUserHome(name, bufferPtr) { struct passwd *pwPtr; Tcl_DString ds; - char *native; + CONST char *native; native = Tcl_UtfToExternalDString(NULL, name, -1, &ds); pwPtr = getpwnam(native); /* INTL: Native. */ @@ -598,7 +598,7 @@ TclpObjGetCwd(interp) } /* Older string based version */ -char * +CONST char * TclpGetCwd(interp, bufferPtr) Tcl_Interp *interp; /* If non-NULL, used for error reporting. */ Tcl_DString *bufferPtr; /* Uninitialized or free DString filled @@ -649,7 +649,7 @@ TclpReadlink(path, linkPtr) { char link[MAXPATHLEN]; int length; - char *native; + CONST char *native; Tcl_DString ds; native = Tcl_UtfToExternalDString(NULL, path, -1, &ds); diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index 32ee2ba..8ff747f 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -7,7 +7,7 @@ * Copyright (c) 1999 by Scriptics Corporation. * All rights reserved. * - * RCS: @(#) $Id: tclUnixInit.c,v 1.28 2001/11/20 09:24:55 hobbs Exp $ + * RCS: @(#) $Id: tclUnixInit.c,v 1.29 2002/01/25 20:40:56 dgp Exp $ */ #include "tclInt.h" @@ -236,10 +236,10 @@ CONST char *path; /* Path to the executable in native { #define LIBRARY_SIZE 32 Tcl_Obj *pathPtr, *objPtr; - char *str; + CONST char *str; Tcl_DString buffer, ds; int pathc; - char **pathv; + CONST char **pathv; char installLib[LIBRARY_SIZE], developLib[LIBRARY_SIZE]; Tcl_DStringInit(&ds); @@ -679,7 +679,7 @@ TclpSetVariables(interp) struct utsname name; #endif int unameOK; - char *user; + CONST char *user; Tcl_DString ds; Tcl_SetVar(interp, "tclDefaultLibrary", defaultLibraryDir, TCL_GLOBAL_ONLY); @@ -688,7 +688,7 @@ TclpSetVariables(interp) unameOK = 0; #ifndef NO_UNAME if (uname(&name) >= 0) { - char *native; + CONST char *native; unameOK = 1; @@ -863,14 +863,14 @@ Tcl_SourceRCFile(interp) Tcl_Interp *interp; /* Interpreter to source rc file into. */ { Tcl_DString temp; - char *fileName; + CONST char *fileName; Tcl_Channel errChannel; fileName = Tcl_GetVar(interp, "tcl_rcFileName", TCL_GLOBAL_ONLY); if (fileName != NULL) { Tcl_Channel c; - char *fullName; + CONST char *fullName; Tcl_DStringInit(&temp); fullName = Tcl_TranslateFileName(interp, fileName, &temp); diff --git a/unix/tclUnixPipe.c b/unix/tclUnixPipe.c index e6187b0..581fee5 100644 --- a/unix/tclUnixPipe.c +++ b/unix/tclUnixPipe.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixPipe.c,v 1.18 2002/01/15 17:55:30 dgp Exp $ + * RCS: @(#) $Id: tclUnixPipe.c,v 1.19 2002/01/25 20:40:56 dgp Exp $ */ #include "tclInt.h" @@ -136,7 +136,7 @@ TclpOpenFile(fname, mode) int mode; /* In what mode to open the file? */ { int fd; - char *native; + CONST char *native; Tcl_DString ds; native = Tcl_UtfToExternalDString(NULL, fname, -1, &ds); @@ -186,7 +186,8 @@ TclFile TclpCreateTempFile(contents) CONST char *contents; /* String to write into temp file, or NULL. */ { - char fileName[L_tmpnam + 9], *native; + char fileName[L_tmpnam + 9]; + CONST char *native; Tcl_DString dstring; int fd; @@ -367,7 +368,7 @@ TclpCreateProcess(interp, argc, argv, inputFile, outputFile, errorFile, * Error messages from the child process * itself are sent to errorFile. */ int argc; /* Number of arguments in following array. */ - char **argv; /* Array of argument strings in UTF-8. + CONST char **argv; /* Array of argument strings in UTF-8. * argv[0] contains the name of the executable * translated using Tcl_TranslateFileName * call). Additional arguments have not been @@ -420,7 +421,8 @@ TclpCreateProcess(interp, argc, argv, inputFile, outputFile, errorFile, newArgv = (char **) ckalloc((argc+1) * sizeof(char *)); newArgv[argc] = NULL; for (i = 0; i < argc; i++) { - newArgv[i] = Tcl_UtfToExternalDString(NULL, argv[i], -1, &dsArray[i]); + Tcl_UtfToExternalDString(NULL, argv[i], -1, &dsArray[i]); + newArgv[i] = Tcl_DStringValue(&dsArray[i]); } joinThisError = errorFile && (errorFile == outputFile); |