diff options
author | dgp <dgp@users.sourceforge.net> | 2003-11-10 20:32:32 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2003-11-10 20:32:32 (GMT) |
commit | 32aba931e84dea723663e8d37fa621e161e4b50e (patch) | |
tree | b7c11636cb7fa70c155508f78e0392153b803a19 /unix/tclUnixInit.c | |
parent | c5930f8386355d42d6789a95167916d37b975b72 (diff) | |
download | tcl-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 'unix/tclUnixInit.c')
-rw-r--r-- | unix/tclUnixInit.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index ae3d2a3..ff033ee 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.34.2.1 2003/05/13 08:41:26 das Exp $ + * RCS: @(#) $Id: tclUnixInit.c,v 1.34.2.2 2003/11/10 20:32:34 dgp Exp $ */ #if defined(HAVE_CFBUNDLE) @@ -338,7 +338,25 @@ CONST char *path; /* Path to the executable in native */ 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; @@ -393,6 +411,7 @@ CONST char *path; /* Path to the executable in native Tcl_ListObjAppendElement(NULL, pathPtr, objPtr); Tcl_DStringFree(&ds); } + ckfree((char *) origv); ckfree((char *) pathv); } |