From c7cd7fb6e29b1b927f64c2ae2dbe369fc83606cf Mon Sep 17 00:00:00 2001 From: Leo Date: Tue, 14 Jul 2026 07:19:07 +0700 Subject: [PATCH] Fix find_local_pkgset failing in directories with spaces Unquoted $PWD and $HERE break the test expression and cd when the current path contains spaces, printing errors on every new shell: find_local_pkgset: line 11: [: `)' expected, found ... find_local_pkgset: line 15: cd: too many arguments Quote the variables so paths with spaces are handled correctly. --- scripts/function/find_local_pkgset | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/function/find_local_pkgset b/scripts/function/find_local_pkgset index 074d9bff..5d006271 100644 --- a/scripts/function/find_local_pkgset +++ b/scripts/function/find_local_pkgset @@ -8,11 +8,11 @@ function find_local_pkgset else local HERE=$PWD T= - while [ \( ! \( -d $TOPFILE \) \) -a \( $PWD != "/" \) ]; do + while [ \( ! \( -d "$TOPFILE" \) \) -a \( "$PWD" != "/" \) ]; do builtin cd .. T=`PWD= /bin/pwd` done - builtin cd $HERE + builtin cd "$HERE" if [ -d "$T/$TOPFILE" ]; then echo $T fi