From ec7daf7f6be4a57b0c29b5eefeed40afe56e6396 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Thu, 23 Oct 2025 13:57:19 +0900 Subject: [PATCH] fix: store filepaths in array I opted to encapsulate these in an array because I was paranoid about needing to separate each directory with a whitespace when storing them on a stringwise basis. This should be safer and ensure the paths don't get concatenated together if the whitespace is omitted. --- dzgui.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/dzgui.sh b/dzgui.sh index 53dd4f2..58975c8 100755 --- a/dzgui.sh +++ b/dzgui.sh @@ -86,14 +86,15 @@ logger(){ } setup_dirs(){ - directories="$state_path " - directories+="$cache_path " - directories+="$share_path " - directories+="$helpers_path " - directories+="$freedesktop_path " - directories+="$config_path " - directories+="$log_path " - for dir in $directories; do + directories=() + directories+=("$state_path") + directories+=("$cache_path") + directories+=("$share_path") + directories+=("$helpers_path") + directories+=("$freedesktop_path") + directories+=("$config_path") + directories+=("$log_path") + for dir in "${directories[@]}"; do mkdir -p "$dir" done }