make “set -o nounset” friendly (even though people who use THAT are at own fault, IMO!)

This commit is contained in:
tg 2012-10-30 21:04:56 +00:00
parent 5aa7842d33
commit bbc0702cdd

View File

@ -1,5 +1,5 @@
# $Id$
# $MirOS: src/bin/mksh/dot.mkshrc,v 1.71 2012/08/17 18:34:20 tg Exp $
# $MirOS: src/bin/mksh/dot.mkshrc,v 1.72 2012/10/30 21:04:56 tg Exp $
#-
# Copyright (c) 2002, 2003, 2004, 2006, 2007, 2008, 2009, 2010,
# 2011, 2012
@ -52,7 +52,7 @@ whence -p hd >&- || function hd {
# Berkeley C shell compatible dirs, popd, and pushd functions
# Z shell compatible chpwd() hook, used to update DIRSTACK[0]
DIRSTACKBASE=$(realpath ~/. 2>&- || print -nr -- "$HOME")
DIRSTACKBASE=$(realpath ~/. 2>&- || print -nr -- "${HOME:-/}")
set -A DIRSTACK
function chpwd {
DIRSTACK[0]=$(realpath . 2>&- || print -r -- "$PWD")