Patch for unix.c

From: Shiro Kawai <shiro_at_squareusa.com>
Date: Thu, 04 Nov 1999 17:31:27 -1000 (HST)

STk_whence in unix.c doesn't return a correct path if the executable
is specified by a relative path from the current working directory.


*** unix.c.orig Sun Sep 26 05:02:14 1999
--- unix.c Thu Nov 4 17:29:52 1999
***************
*** 518,523 ****
--- 518,536 ----
      return;
    }
  
+ /* the executable path may be specified by relative path from the cwd. */
+ if (strchr(exec, DIRSEP) != NULL) {
+ char relpath[2*MAX_PATH_LENGTH], abspath[2*MAX_PATH_LENGTH];
+ char *r = relpath;
+ getcwd(r, MAX_PATH_LENGTH);
+ r += strlen(r);
+ *r++ = DIRSEP;
+ strncpy(r, exec, MAX_PATH_LENGTH);
+ absolute(relpath, abspath);
+ strncpy(path, abspath, MAX_PATH_LENGTH);
+ return;
+ }
+
  #ifdef FREEBSD
    /* I don't understand why this is needed */
    if (access(path, X_OK) == 0) {
Received on Fri Nov 05 1999 - 04:31:41 CET

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