From 4a61f53b85d4a6640b656f8442c40fb9cfb8df2d Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Wed, 4 Jun 2025 12:20:54 +0900 Subject: [PATCH] [bash,zsh] Remove redundant filtering-out of comment/blank lines Comments are anyway removed in the subsequent call to `sub(/#.*/, "")`, and it becomes a blank line. Blank lines do not have fields, so they are ignored in the next for-loop. --- shell/completion.bash | 4 ---- shell/completion.zsh | 4 ---- 2 files changed, 8 deletions(-) diff --git a/shell/completion.bash b/shell/completion.bash index c489c5a0..48a34c9b 100644 --- a/shell/completion.bash +++ b/shell/completion.bash @@ -513,10 +513,6 @@ if ! declare -F __fzf_list_hosts > /dev/null; then ) \ <( __fzf_exec_awk ' - # Note: mawk <= 1.3.3-20090705 does not support the POSIX brackets of - # the form [[:blank:]], and Ubuntu 18.04 LTS still uses this - # 16-year-old mawk unfortunately. We need to use [ \t] instead. - /^[ \t]*(#|$)/ { next } { sub(/#.*/, "") for (i = 2; i <= NF; i++) diff --git a/shell/completion.zsh b/shell/completion.zsh index e0227007..950fa674 100644 --- a/shell/completion.zsh +++ b/shell/completion.zsh @@ -291,10 +291,6 @@ if ! declare -f __fzf_list_hosts > /dev/null; then ) \ <( __fzf_exec_awk ' - # Note: mawk <= 1.3.3-20090705 does not support the POSIX brackets of - # the form [[:blank:]], and Ubuntu 18.04 LTS still uses this - # 16-year-old mawk unfortunately. We need to use [ \t] instead. - /^[ \t]*(#|$)/ { next } { sub(/#.*/, "") for (i = 2; i <= NF; i++)