From ec2da1a557337160c55cb16e3a9573714ea3865d Mon Sep 17 00:00:00 2001 From: Silvan Jegen Date: Sat, 7 Sep 2019 16:20:57 +0200 Subject: [PATCH] mless: only export LESSKEY once --- mless | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mless b/mless index 390ebcf..b859a15 100755 --- a/mless +++ b/mless @@ -63,14 +63,14 @@ nl=" " export MLESS_RAW=0 export MLESS_HTML=0 +if [ -f "$MBLAZE/mless" ]; then + export LESSKEY="$MBLAZE/mless" +elif [ -f "$HOME/.mblaze/mless" ]; then + export LESSKEY="$HOME/.mblaze/mless" +elif [ -f "$HOME/.mless" ]; then + export LESSKEY="$HOME/.mless" +fi while :; do - if [ -f "$MBLAZE/mless" ]; then - export LESSKEY="$MBLAZE/mless" - elif [ -f "$HOME/.mblaze/mless" ]; then - export LESSKEY="$HOME/.mblaze/mless" - elif [ -f "$HOME/.mless" ]; then - export LESSKEY="$HOME/.mless" - fi LESSOPEN="|$0 --filter %s" \ less -Ps"mless %f?m (message %i of %m).." -R \ "+:e $(mscan -n .)$nl" //scan $(mscan -n :)