summaryrefslogtreecommitdiff
path: root/editors/nvi-m17n/files
diff options
context:
space:
mode:
authorobache <obache>2007-11-19 12:24:06 +0000
committerobache <obache>2007-11-19 12:24:06 +0000
commitdeb5c9bc29ab75571c22f894940d97ce703a342e (patch)
treef0a5c7f55c8abe40216ba03eb0715c41dc63f16f /editors/nvi-m17n/files
parent57e7a5dc6a2428ed17a4b49007ea6f1a51675cc6 (diff)
downloadpkgsrc-deb5c9bc29ab75571c22f894940d97ce703a342e.tar.gz
Improve wrapper script, closing to usual behavior.
* Pass settings to nvi with env NEXINIT instead of EXINIT, to avoid affect of env NEXINIT. * Honor NEXINIT, EXINIT environment variable. * Pass all setting in ~/.{n}exrc by using source command. Fixes PR 13677. Bump PKGREVISION.
Diffstat (limited to 'editors/nvi-m17n/files')
-rwxr-xr-xeditors/nvi-m17n/files/nvi-m17n17
1 files changed, 13 insertions, 4 deletions
diff --git a/editors/nvi-m17n/files/nvi-m17n b/editors/nvi-m17n/files/nvi-m17n
index b977641b370..6b8370e4103 100755
--- a/editors/nvi-m17n/files/nvi-m17n
+++ b/editors/nvi-m17n/files/nvi-m17n
@@ -1,9 +1,18 @@
#! /bin/sh
EXINIT0="set ${CANNA_OPT} autodetect=${AUTODETECT} fileencoding=${ENCODING} displayencoding=${ENCODING} inputencoding=${ENCODING} noskipdisplay"
-if [ -f ~/.exrc ]; then
- EXINIT="$EXINIT0 `sed -e '/^set /!d' -e 's/^set //' < ~/.exrc | tr '\012' ' '`"
+if [ "x$NEXINIT" != "x" -a "${NEXINIT-UNSET}" != "UNSET" ]; then
+ EXINIT1="$NEXINIT"
+elif [ "x$EXINIT" != "x" -a "${EXINIT-UNSET}" != "UNSET" ]; then
+ EXINIT1="$EXINIT"
else
- EXINIT=$EXINIT0
+ ecfile="/dev/null"
+ if [ -f "${HOME}/.nexrc" ]; then
+ rcfile="$HOME/.nexrc"
+ elif [ -f "${HOME}/.exrc" ]; then
+ rcfile="$HOME/.exrc"
+ fi
+ EXINIT1="source $rcfile"
fi
-export EXINIT
+NEXINIT="$EXINIT0|$EXINIT1"
+export NEXINIT
exec ${PREFIX}/bin/nvi "$@"