From edbf5ba932440148a7c54e88abaa56c6f58a53f3 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 28 May 2026 11:01:33 +0300 Subject: Fix tmpclean: guard against empty age variables in test comparisons --- fish/conf.d/tmputils.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fish') diff --git a/fish/conf.d/tmputils.fish b/fish/conf.d/tmputils.fish index 9ef69f8..9d441e8 100644 --- a/fish/conf.d/tmputils.fish +++ b/fish/conf.d/tmputils.fish @@ -112,7 +112,7 @@ function tmpclean # If the folder is empty or has no files, check its own mtime if test -z "$newest" set -l folder_age (math \( (date +%s) - (stat -c %Y "$folder") \) / 86400) - if test $folder_age -ge $threshold + if test -n "$folder_age"; and test "$folder_age" -ge $threshold set -l basename (basename "$folder") set -l dest "$old_dir/$basename.$datestamp" if set -q dry_run @@ -129,7 +129,7 @@ function tmpclean set -l file_secs (math floor "$newest") set -l age_days (math \( (date +%s) - $file_secs \) / 86400) - if test $age_days -ge $threshold + if test -n "$age_days"; and test "$age_days" -ge $threshold set -l basename (basename "$folder") set -l dest "$old_dir/$basename.$datestamp" if set -q dry_run -- cgit v1.2.3