Yet another patch to STk-3.1.1

From: David Fox <fox_at_cat.nyu.edu>
Date: Thu, 21 Nov 1996 12:59:26 -0500 (EST)

My previous patch to allow STk to work when your path does not
contain "." missed the case of programs being invoked relative
to the current directory but not starting with ".", e.g.

% debug/foo

runs foo in subdir debug even if "." is not in your path. Here
is the updated patch to unix.c:

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] == '.' || index(exec, '/')) {
+ 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://www.cat.nyu.edu/fox            xoF divaD
NYU Media Research Lab     fox_at_cs.nyu.edu     baL hcraeseR aideM UYN
Received on Mon Nov 25 1996 - 12:13:15 CET

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST