Package: less
Version: 643-1
Severity: normal
Tags: patch

As title says, variable expansion and assignment is unreliable at best to not
happening at worst when the '~' shorthand is used, the patch simply replaces it
for the '$HOME' variable.


-- System Information:
Distributor ID: Devuan
Description:    Devuan GNU/Linux 6 (excalibur/ceres)
Release:        6
Codename:       excalibur ceres
Architecture: x86_64

Kernel: Linux 6.11.4-amd64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: sysvinit (via /sbin/init)
LSM: AppArmor: enabled

Versions of packages less depends on:
ii  libc6      2.40-3
ii  libtinfo6  6.5-2

less recommends no packages.

less suggests no packages.

-- no debconf information
>From a0cda7ff448e9c676ab104fbd763d761253c8e72 Mon Sep 17 00:00:00 2001
From: eylles <[email protected]>
Date: Mon, 21 Apr 2025 09:13:07 -0600
Subject: [PATCH] Use HOME var

The shorthand '~' has unreliable behaviour when used inside variable assignment
and expansion, the HOME variable is preferred for such cases.
---
 debian/lesspipe | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/debian/lesspipe b/debian/lesspipe
index 57ef4f1..18abc19 100644
--- a/debian/lesspipe
+++ b/debian/lesspipe
@@ -25,7 +25,7 @@
 #    $2  filename that was created during LESSOPEN
 
 TMPDIR=${TMPDIR:-/tmp}
-CONFIGDIR=${XDG_CONFIG_HOME:-~/.config}
+CONFIGDIR=${XDG_CONFIG_HOME:-$HOME/.config}
 BASENAME=`basename $0`
 LESSFILE=lessfile
 
@@ -61,8 +61,8 @@ if [ $# -eq 1 ] ; then
                USERFILTER=
                if [ -x "$CONFIGDIR/lessfilter" ]; then
                        USERFILTER="$CONFIGDIR/lessfilter"
-               elif [ -x ~/.lessfilter ]; then
-                       USERFILTER=~/.lessfilter
+               elif [ -x "$HOME/.lessfilter" ]; then
+                       USERFILTER="$HOME/.lessfilter"
                fi
                if [ -n "$USERFILTER" ]; then
                        if [ $BASENAME = $LESSFILE ]; then
-- 
2.45.2

Reply via email to