summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1995-07-07 23:14:36 +0000
committerache <ache@FreeBSD.org>1995-07-07 23:14:36 +0000
commit56b16b74bf576e383adda67bcf4171d64d7349e2 (patch)
treef9062ae36511bd8ff39c32c903943e954d6f6991 /bin
parentbd0186909e167e5650e2c8560baf031414724ff0 (diff)
downloadFreeBSD-src-56b16b74bf576e383adda67bcf4171d64d7349e2.zip
FreeBSD-src-56b16b74bf576e383adda67bcf4171d64d7349e2.tar.gz
Move first PATH initialization after sensing for interactive,
first relative path warning was disabled in old case
Diffstat (limited to 'bin')
-rw-r--r--bin/csh/csh.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/bin/csh/csh.c b/bin/csh/csh.c
index d43fb61..80f118c 100644
--- a/bin/csh/csh.c
+++ b/bin/csh/csh.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: csh.c,v 1.3 1995/05/30 00:06:30 rgrimes Exp $
+ * $Id: csh.c,v 1.4 1995/07/07 22:45:26 ache Exp $
*/
#ifndef lint
@@ -248,14 +248,6 @@ main(argc, argv)
if ((tcp = getenv("TERM")) != NULL)
set(STRterm, SAVE(tcp));
- /*
- * Re-initialize path if set in environment
- */
- if ((tcp = getenv("PATH")) == NULL)
- set1(STRpath, defaultpath(), &shvhed);
- else
- importpath(SAVE(tcp));
-
set(STRshell, Strsave(STR_SHELLPATH));
doldol = putn((int) getpid()); /* For $$ */
@@ -417,6 +409,16 @@ main(argc, argv)
stderror(ERR_SYSTEM, "csh", strerror(errno));
}
}
+
+ /*
+ * Re-initialize path if set in environment
+ * importpath uses intty and intact
+ */
+ if ((tcp = getenv("PATH")) == NULL)
+ set1(STRpath, defaultpath(), &shvhed);
+ else
+ importpath(SAVE(tcp));
+
/*
* Decide whether we should play with signals or not. If we are explicitly
* told (via -i, or -) or we are a login shell (arg0 starts with -) or the
@@ -618,7 +620,7 @@ importpath(cp)
for (;;) {
if ((c = *dp) == ':' || c == 0) {
*dp = 0;
- if ((*cp != '/' || *cp == '\0') && (euid == 0 || uid == 0) &&
+ if (*cp != '/' && (euid == 0 || uid == 0) &&
(intact || intty && isatty(SHOUT)))
(void) fprintf(csherr,
"Warning: imported path contains relative components\n");
OpenPOWER on IntegriCloud