From: Peter Avalos Date: Sun, 21 Aug 2011 20:42:26 +0000 (-0700) Subject: sh: Read .profile from the home directory (or / if HOME is not set). X-Git-Tag: v2.12.0~151 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/24fd06d29173f5a899b47eea7bbe7b75862f8cf5 sh: Read .profile from the home directory (or / if HOME is not set). In most cases, login shells are started from the home directory, but not in all, such as xterm -ls. Obtained-from: FreeBSD 223005 --- diff --git a/bin/sh/main.c b/bin/sh/main.c index 1a8ffdb4df..c95655ab0b 100644 --- a/bin/sh/main.c +++ b/bin/sh/main.c @@ -35,7 +35,7 @@ * * @(#) Copyright (c) 1991, 1993 The Regents of the University of California. All rights reserved. * @(#)main.c 8.6 (Berkeley) 5/28/95 - * $FreeBSD: src/bin/sh/main.c,v 1.50 2011/06/10 22:42:00 jilles Exp $ + * $FreeBSD: src/bin/sh/main.c,v 1.51 2011/06/12 10:13:48 jilles Exp $ */ #include @@ -144,7 +144,7 @@ main(int argc, char *argv[]) state1: state = 2; if (privileged == 0) - read_profile(".profile"); + read_profile("${HOME-}/.profile"); else read_profile("/etc/suid_profile"); }