diff --git a/functions/_riot b/functions/_riot index fd663cb..1b044df 100644 --- a/functions/_riot +++ b/functions/_riot @@ -80,7 +80,7 @@ _riot_presets() { [[ -z $DOTFILES ]] || config_files+=("$DOTFILES/riot-config.sh") config_files+=("$HOME/.config/riot-config.sh" "$PWD/riot-config.sh") - for file in "$config_files[@]"; do + for file in "${config_files[@]}"; do [[ -r $file ]] || continue presets+=("${(@f)$(sed -nE 's/^([[:alnum:]_.-]+)\.(remote|batch)\(\).*/\1/p' "$file" 2>/dev/null)}") done diff --git a/scripts/riot b/scripts/riot index c572adf..93a27bb 100755 --- a/scripts/riot +++ b/scripts/riot @@ -542,7 +542,7 @@ router() { local option="" local remaining="" local option_value="" - while [[ $# > 0 || -n "$arg" ]]; do + while [[ $# -gt 0 || -n "$arg" ]]; do if [[ -z "$arg" ]]; then arg=$1 shift diff --git a/tools/common.sh b/tools/common.sh index 0f9c825..328f5f8 100755 --- a/tools/common.sh +++ b/tools/common.sh @@ -12,7 +12,7 @@ if [[ "${BASH_SOURCE[0]}" != "${0}" && "$DFS_SKIP_ARG_PARSE" != "1" ]]; then ORIGIN_ARGS=("$@") ARG="" GOT_OPTS=() - while [[ $# > 0 || -n "$ARG" ]]; do + while [[ $# -gt 0 || -n "$ARG" ]]; do if [[ -z "$ARG" ]]; then if [[ "$1" == "--" ]]; then GOT_OPTS+=("$@"); break; fi ARG="$1"; shift;