delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/10/01/03:55:16

Date: Tue, 1 Oct 1996 09:51:49 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: djgpp-workers AT delorie DOT com
Subject: Script invocation by `dosexec'
Message-Id: <Pine.SUN.3.91.961001094848.23760R-100000@is>
Mime-Version: 1.0

I got a report from a user of the alpha Make port which seems to indicate 
that some script interpreters might not look for the script along the 
$PATH.  Even if that is not so, I think passing the exact pathname of the 
script is a Good Thing since it eliminates the need to search the PATH.
So here is the patch:

*** src/libc/dos/process/dosexec.c~2	Sun Sep 15 11:53:34 1996
--- src/libc/dos/process/dosexec.c	Mon Sep 30 11:26:18 1996
*************** static int script_exec(const char *progr
*** 895,901 ****
    for (i=0; argv[i]; i++)
      newargs[i+1+hasargs] = unconst(argv[i], char *);
    newargs[i+1+hasargs] = 0;
!   newargs[0] = unconst(argv[0], char *);
    if (hasargs)
      newargs[1] = iargs;
  
--- 895,903 ----
    for (i=0; argv[i]; i++)
      newargs[i+1+hasargs] = unconst(argv[i], char *);
    newargs[i+1+hasargs] = 0;
!   /* Some interpreters might have their own ideas about $PATH.
!      Therefore, pass them the full pathname of the script.  */
!   newargs[0] = newargs[1+hasargs] = unconst(program, char *);
    if (hasargs)
      newargs[1] = iargs;
  

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019