commit 57480153adee5b08e9748baeabd6aa11997f17c7 parent 29cfb84fede08cb68fc386ad1c5eb3d164262649 Author: Sebastiano Tronto <sebastiano@tronto.net> Date: Mon, 21 Feb 2022 15:44:09 +0100 Fixed picking going up to / with .. Diffstat:
M | dmenu-filepicker | | | 5 | +++-- |
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dmenu-filepicker b/dmenu-filepicker @@ -13,8 +13,9 @@ while true; do if [ "$sel" = "." ]; then echo "$fullpath" | sed 's|/\.||' break - elif [ -d "$fullpath" ]; then - sel=$(ls -a "$fullpath" | sed 's|.*/||' | $menu $menuopts) + elif [ -d "$fullpath" ] || [ -z "$fullpath" ]; then + if [ -z "$fullpath" ]; then fp="/"; else fp="$fullpath"; fi + sel=$(ls -a "$fp" | sed 's|.*/||' | $menu $menuopts) if [ "$sel" = ".." ]; then fullpath=$(echo "$fullpath" | sed "s|/[^/]*$||") else