summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2003-11-10 20:32:32 (GMT)
committerdgp <dgp@users.sourceforge.net>2003-11-10 20:32:32 (GMT)
commit32aba931e84dea723663e8d37fa621e161e4b50e (patch)
treeb7c11636cb7fa70c155508f78e0392153b803a19 /win
parentc5930f8386355d42d6789a95167916d37b975b72 (diff)
downloadtcl-32aba931e84dea723663e8d37fa621e161e4b50e.zip
tcl-32aba931e84dea723663e8d37fa621e161e4b50e.tar.gz
tcl-32aba931e84dea723663e8d37fa621e161e4b50e.tar.bz2
* tests/unixInit.test (unixInit-2.10): re-enabled.
* unix/tclUnixInit.c (TclpInitLibraryPath): Alternative fix * win/tclWinInit.c (TclpInitLibraryPath): for [Bug 832657] that should not run afoul of startup constraints.
Diffstat (limited to 'win')
-rw-r--r--win/tclWinInit.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/win/tclWinInit.c b/win/tclWinInit.c
index f3f0865..2a87937 100644
--- a/win/tclWinInit.c
+++ b/win/tclWinInit.c
@@ -7,7 +7,7 @@
* Copyright (c) 1998-1999 by Scriptics Corporation.
* All rights reserved.
*
- * RCS: @(#) $Id: tclWinInit.c,v 1.40.2.1 2003/08/06 23:50:06 hobbs Exp $
+ * RCS: @(#) $Id: tclWinInit.c,v 1.40.2.2 2003/11/10 20:32:34 dgp Exp $
*/
#include "tclWinInt.h"
@@ -197,7 +197,7 @@ TclpInitLibraryPath(path)
*/
sprintf(installLib, "lib/tcl%s", TCL_VERSION);
- sprintf(developLib, "../tcl%s/library", TCL_PATCH_LEVEL);
+ sprintf(developLib, "tcl%s/library", TCL_PATCH_LEVEL);
/*
* Look for the library relative to default encoding dir.
@@ -252,7 +252,25 @@ TclpInitLibraryPath(path)
*/
if (path != NULL) {
- Tcl_SplitPath(path, &pathc, &pathv);
+ int i, origc;
+ CONST char **origv;
+
+ Tcl_SplitPath(path, &origc, &origv);
+ pathc = 0;
+ pathv = (CONST char **) ckalloc((unsigned int)(origc * sizeof(char *)));
+ for (i=0; i< origc; i++) {
+ if (origv[i][0] == '.') {
+ if (strcmp(origv[i], ".") == 0) {
+ /* do nothing */
+ } else if (strcmp(origv[i], "..") == 0) {
+ pathc--;
+ } else {
+ pathv[pathc++] = origv[i];
+ }
+ } else {
+ pathv[pathc++] = origv[i];
+ }
+ }
if (pathc > 2) {
str = pathv[pathc - 2];
pathv[pathc - 2] = installLib;
@@ -307,6 +325,7 @@ TclpInitLibraryPath(path)
Tcl_ListObjAppendElement(NULL, pathPtr, objPtr);
Tcl_DStringFree(&ds);
}
+ ckfree((char *) origv);
ckfree((char *) pathv);
}