From 4c0e2df36afa4168baab2930f74e646921fa07a0 Mon Sep 17 00:00:00 2001
From: Ian Kelling <iank@fsf.org>
Date: Wed, 9 Oct 2024 01:45:19 -0400
Subject: [PATCH] minor improvement: if ls has nonzero exit, return it

---
 ll-function | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/ll-function b/ll-function
index f683464..5b2c36b 100644
--- a/ll-function
+++ b/ll-function
@@ -41,7 +41,7 @@ EOF
       ;;
   esac
   local x y perm line binls sizePadding middle tail size \
-        max_hl_digits hardlinks initial_space hardlink_spacing
+        max_hl_digits hardlinks initial_space hardlink_spacing out
   local max_hl_digits=0
   local -a lines hl
   binls=$(type -P ls)
@@ -50,6 +50,8 @@ EOF
     $binls -lA "$@"
     return
   fi
+  out=$("$binls" -lAh --color=always "--time-style=+%m-%d     %Y
+%m-%d %I:%M %P" "$@")
   local aclchar=false
   # there's no way to tell if ls uses the acl specifier unless we loop over the data twice
   # the 11th char is either
@@ -87,8 +89,7 @@ EOF
       fi
       hl+=("$hardlinks")
     fi
-  done< <( "$binls" -lAh --color=always "--time-style=+%m-%d     %Y
-%m-%d %I:%M %P" "$@" )
+  done<<<"$out"
 
   hardlink_spacing=$((max_hl_digits + 1))
 
-- 
2.30.2