summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstanton <stanton>1998-06-17 18:19:11 (GMT)
committerstanton <stanton>1998-06-17 18:19:11 (GMT)
commitbe486008c26347f368f3951fa1ddd0224156e7f1 (patch)
treea349823ed3ebf8d80d78fb63de3e124c4b61ca50
parent5d04357f5662d07957027ecc2702276dfcc0bf59 (diff)
downloadtcl-be486008c26347f368f3951fa1ddd0224156e7f1.zip
tcl-be486008c26347f368f3951fa1ddd0224156e7f1.tar.gz
tcl-be486008c26347f368f3951fa1ddd0224156e7f1.tar.bz2
fixed behavior of Tcl_FindExecutable on null path elements
-rw-r--r--unix/tclUnixFile.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c
index 7f9644b..86f3d33 100644
--- a/unix/tclUnixFile.c
+++ b/unix/tclUnixFile.c
@@ -254,6 +254,12 @@ Tcl_FindExecutable(argv0)
*/
p = ":/bin:/usr/bin";
+ } else if (*p == '\0') {
+ /*
+ * An empty path is equivalent to ".".
+ */
+
+ p = "./";
}
/*
@@ -286,8 +292,11 @@ Tcl_FindExecutable(argv0)
}
if (*p == 0) {
break;
+ } else if (*(p+1) == 0) {
+ p = "./";
+ } else {
+ p++;
}
- p++;
}
goto done;