This patch lets STk built a value in STk_Argv0 even when the user's
$PATH doesn't contain ".". It also tends to handle relative pathnames
in argv[0] more correctly -- the original code can find the wrong
executable depending on the order of the path elements.
diff -ru STk-3.1/Src/unix.c~ STk-3.1/Src/unix.c
--- STk-3.1/Src/unix.c~ Sun Jul 21 11:22:37 1996
+++ STk-3.1/Src/unix.c Thu Oct 17 12:39:59 1996
_at_@ -445,6 +445,13 @@
return;
}
+ if (exec[0] == '.') {
+ getcwd(path, MAX_PATH_LENGTH);
+ strcat(path, "/");
+ strcat(path, exec);
+ return;
+ }
+
#ifdef FREEBSD
/* I don't understand why this is needed */
if (access(path, X_OK) == 0) {
--
David Fox http://found.cs.nyu.edu/fox xoF divaD
NYU Media Research Lab fox_at_cs.nyu.edu baL hcraeseR aideM UYN
Received on Thu Oct 17 1996 - 19:23:18 CEST