#! /bin/sh
EXINIT0="set  autodetect=tw fileencoding=euc-tw displayencoding=euc-tw inputencoding=euc-tw noskipdisplay"
if [ "x$NEXINIT" != "x" -a "${NEXINIT-UNSET}" != "UNSET" ]; then
	EXINIT1="$NEXINIT"
elif [ "x$EXINIT" != "x" -a "${EXINIT-UNSET}" != "UNSET" ]; then
	EXINIT1="$EXINIT"
else
	rcfile="/dev/null"
	if [ -f "${HOME}/.nexrc" ]; then
		rcfile="$HOME/.nexrc"
	elif [ -f "${HOME}/.exrc" ]; then
		rcfile="$HOME/.exrc"
	fi
	EXINIT1="source $rcfile"
fi
NEXINIT="$EXINIT0|$EXINIT1"
export NEXINIT
exec /usr/pkg/bin/nvi "$@"
