tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Per-shell override of path names in make(1)



On Thu, Feb 07, 2008 at 11:56:07AM -0800, Simon J. Gerraty wrote:
> >Index: job.c
> >===================================================================
> >RCS file: /data/repo/netbsd/src/usr.bin/make/job.c,v
> >retrieving revision 1.135
> >diff -u -p -r1.135 job.c
> >--- job.c    19 Jan 2008 06:52:14 -0000      1.135
> >+++ job.c    6 Feb 2008 22:30:34 -0000
> >@@ -239,6 +239,11 @@ static Shell    shells[] = {
> 
> This block won't apply - DEFSHELL_CUSTOM isn't normally defined.

#ifdef DEFSHELL_CUSTOM is just beyond the context of the patch.

> >@@ -2064,7 +2069,7 @@ Shell_Init(void)
> >         shellName++;
> >     } else
> > #endif
> >-    shellPath = str_concat(_PATH_DEFSHELLDIR, shellName, STR_ADDSLASH);
> >+    shellPath = commandShell->path;
> 
> The above assumes that DEFAULT_SH etc would always be
> absolute paths.  I don't think that's a safe assumption.

Why is that *not* a safe assumption? The default values are absolute and
if you override them, it is safe to require that you provide an absolute
name. The code still assumes that the name is "sh", but if that is not
deseriable, the complete DEFSHELL_CUSTOM part can be folded into the
DEFAULT_SH case.

Joerg



Home | Main Index | Thread Index | Old Index