Make last change a little more robust by checking for failure of getcwd().

This commit is contained in:
David Greenman 1995-05-22 11:03:55 +00:00
parent 82c76939c1
commit 956455631c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=8697

View File

@ -29,6 +29,8 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id$
*/
#ifndef lint
@ -632,7 +634,8 @@ pass(passwd)
/*
* Set home directory so that use of ~ (tilde) works correctly.
*/
setenv("HOME", getcwd(homedir, MAXPATHLEN), 1);
if (getcwd(homedir, MAXPATHLEN) != NULL)
setenv("HOME", homedir, 1);
/*
* Display a login message, if it exists.