From be486008c26347f368f3951fa1ddd0224156e7f1 Mon Sep 17 00:00:00 2001 From: stanton Date: Wed, 17 Jun 1998 18:19:11 +0000 Subject: fixed behavior of Tcl_FindExecutable on null path elements --- unix/tclUnixFile.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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; -- cgit v0.12